Commit aa9be5aa authored by Angelo Veltens's avatar Angelo Veltens

build job to publish latest image

parent ce5cf6de
Pipeline #37839893 (#17) passed with stages
in 6 minutes and 9 seconds
......@@ -3,6 +3,7 @@ image: node
stages:
- test
- build
- publish
test:
stage: test
......@@ -63,3 +64,20 @@ build_and_publish_image:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- docker build --pull -t $IMAGE_TAG .
- docker push $IMAGE_TAG
publish_latest_image:
image: docker:stable
stage: publish
services:
- docker:dind
variables:
IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
LATEST_TAG: $CI_REGISTRY_IMAGE:latest
script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- docker pull $IMAGE_TAG
- docker tag $IMAGE_TAG $LATEST_TAG
- docker push $LATEST_TAG
when: manual
only:
- master
\ No newline at end of file
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