Skip to content
Snippets Groups Projects
Commit c58aa33db874 authored by Xavier Garnier's avatar Xavier Garnier :bicyclist:
Browse files

ci(docker): build and push frontend docker image

parent c73eaa85abce
No related branches found
No related tags found
1 merge request!7Topic/default/docker compose
......@@ -14,3 +14,56 @@
js-build:
script:
- cd frontend && npm run build
front_image_build:
extends: .retry
stage: release
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
before_script:
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
script:
- /kaniko/executor
--context $CI_PROJECT_DIR/frontend
--dockerfile $CI_PROJECT_DIR/frontend/Dockerfile
--destination $CI_REGISTRY_IMAGE/frontend:$CI_COMMIT_HG_SHORT_SHA
--cache=${KANIKO_ENABLE_CACHE:-true}
--cache-repo $CI_REGISTRY_IMAGE/frontend/cache
--cache-ttl 120h
rules:
- if: '$CI_COMMIT_REF_NAME != $CI_DEFAULT_BRANCH'
variables:
KUBERNETES_MEMORY_LIMIT: 2Gi
front_image_build_latest:
extends: front_image_build
script:
- /kaniko/executor
--context $CI_PROJECT_DIR/frontend
--dockerfile $CI_PROJECT_DIR/frontend/Dockerfile
--destination $CI_REGISTRY_IMAGE/frontend:$CI_COMMIT_HG_SHORT_SHA
--destination $CI_REGISTRY_IMAGE/frontend:latest
--cache=${KANIKO_ENABLE_CACHE:-true}
--cache-repo $CI_REGISTRY_IMAGE/frontend/cache
--cache-ttl 120h
rules:
- if: '$CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH'
front_image_build_tag:
extends: front_image_build
script:
- /kaniko/executor
--context $CI_PROJECT_DIR/frontend
--dockerfile $CI_PROJECT_DIR/frontend/Dockerfile
--destination $CI_REGISTRY_IMAGE/frontend:$CI_COMMIT_HG_SHORT_SHA
--destination $CI_REGISTRY_IMAGE/frontend:$CI_COMMIT_TAG
--cache=${KANIKO_ENABLE_CACHE:-true}
--cache-repo $CI_REGISTRY_IMAGE/frontend/cache
--cache-ttl 120h
rules:
- if: "$CI_MERGE_REQUEST_ID"
when: never
- if: "$CI_COMMIT_TAG"
when: on_success
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment