Added new vailables from gitlab-ci.yml

This commit is contained in:
Matthew McKinnon 2022-08-07 14:28:37 +10:00
parent fded12a15b
commit ebeb6d7eda

View File

@ -1,6 +1,11 @@
variables:
- IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
- IMAGE_TAG_LATEST: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
stages: stages:
- build-eleventy - build-eleventy
- docker-build - docker-build
build-eleventy: build-eleventy:
stage: build-eleventy stage: build-eleventy
image: node:latest image: node:latest
@ -16,17 +21,16 @@ build-eleventy:
only: only:
- master - master
services:
- docker:dind
docker-build: docker-build:
services:
- docker:dind
stage: docker-build stage: docker-build
image: docker:latest image: docker:latest
script: script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker build --pull -t $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG . - docker build --pull -t $IMAGE_TAG .
- docker push $CI_REGISTRY/$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG - docker push $IMAGE_TAG
- docker tag $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG $CI_REGISTRY_IMAGE:latest - docker tag $IMAGE_TAG $IMAGE_TAG_LATEST
- docker push $CI_REGISTRY/$CI_REGISTRY_IMAGE:latest - docker push $IMAGE_TAG_LATEST
only: only:
- master - master