Commit adc4c4b4 authored by Tom Käsler's avatar Tom Käsler
Browse files

Merge branch 'ci'

parents 6606bed9 f7825fd9
Pipeline #67949 passed with stages
in 3 minutes and 6 seconds
variables:
BUILD_DIR: dist
NODE_VERSION: "12.18"
YARN_CACHE_FOLDER: .yarn-cache
stages:
- prepare
- build
- deploy
.yarn_cache: &yarn_cache
key: yarn-cache
paths:
- node_modules
- $YARN_CACHE_FOLDER
yarn_populate_cache:
stage: prepare
tags:
- yarn
rules:
- if: '$CI_COMMIT_BRANCH != "master" || $CI_MERGE_REQUEST_ID'
when: never
- changes:
- package.json
- yarn.lock
when: always
- when: manual
# allow_failure: Do not block pipeline if job is created but not run.
allow_failure: true
cache:
<<: *yarn_cache
policy: pull-push
script:
- echo Populating cache...
- umask 0000
- yarn --frozen-lockfile
yarn_install:
stage: prepare
tags:
- yarn
artifacts:
expire_in: 12 hours
paths:
- node_modules
cache:
<<: *yarn_cache
policy: pull
script:
- umask 0000
- yarn --frozen-lockfile
ngbuild:
stage: build
tags:
- yarn
needs:
- yarn_install
allow_failure: false
artifacts:
paths:
- "$BUILD_DIR"
script:
- yarn build
docker_image:
stage: deploy
tags:
- kaniko
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
needs:
- ngbuild
script:
- mkdir -p /kaniko/.docker
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"auth\":\"$(echo -n ${CI_REGISTRY_USER}:${CI_REGISTRY_PASSWORD} | base64)\"}}}" > /kaniko/.docker/config.json
- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination $CI_REGISTRY/$CI_PROJECT_PATH:$CI_COMMIT_REF_SLUG
FROM nginx:stable-alpine as production-stage
COPY dist /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment