Skip to content
Snippets Groups Projects
Commit b209b008 authored by Jiri Raja's avatar Jiri Raja
Browse files

ci: added job to build the docker image

parent 651c9798
No related branches found
No related tags found
No related merge requests found
Pipeline #600278 failed
default:
interruptible: true
artifacts:
expire_in: 30 days
stages:
- build
build_docker_image:
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [ "" ]
stage: build
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_COMMIT_REF_PROTECTED == "true"
- if: $CI_COMMIT_TAG =~ /^[0-9]+\.[0-9]+\.([0-9]|[0-z])+$/
before_script:
- if [ -n "$CI_COMMIT_TAG" ]; then export DOCKER_TAG=$CI_COMMIT_TAG; else export DOCKER_TAG=$CI_COMMIT_SHA; fi
script:
- echo "{\"auths\":{\"${CI_REGISTRY}\":{\"username\":\"${CI_REGISTRY_USER}\",\"password\":\"${CI_REGISTRY_PASSWORD}\"}}}" > /kaniko/.docker/config.json
- /kaniko/executor
--context $CI_PROJECT_DIR
--target production
--skip-unused-stages
--destination $CI_REGISTRY_IMAGE/frontend:$DOCKER_TAG
--destination $CI_REGISTRY_IMAGE/frontend:latest
......@@ -16,5 +16,3 @@ FROM nginx:alpine as production
COPY default.conf /etc/nginx/conf.d/default.conf
COPY --from=builder /app/dist/frontend/browser /usr/share/nginx/html
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment