Commit 4cbbbb17 authored by Daniel Plakinger's avatar Daniel Plakinger 🦉
Browse files

ci: build image

parent 351405f7
Loading
Loading
Loading
Loading
+21 −0
Original line number Diff line number Diff line
image: node:14-alpine

variables:
  APP_IMAGE: "registry.gitlab.ics.muni.cz:443/analyza/visilant"

stages:
  - install
  - lint
  - build
  - build_image

yarn:
  stage: install
@@ -38,3 +42,20 @@ build:
    expire_in: 1 week
    paths:
      - dist

build_image:
  stage: build-image
  image: docker:19.03.12
  before_script:
    - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY || true
  script:
    - docker pull $APP_IMAGE:latest || true
    - >
      docker build
      --pull
      --cache-from $APP_IMAGE:latest
      --tag $APP_IMAGE:$CI_COMMIT_REF_SLUG
      packages/app
    - docker push $APP_IMAGE:$CI_COMMIT_REF_SLUG
  dependencies:
    - build