Added Docker build deploy scripts

This commit is contained in:
Matthew McKinnon 2022-08-07 14:05:13 +10:00
parent d652ea7380
commit a30002a7a0

View File

@ -1,7 +1,8 @@
stages:
- build-eleventy
- docker-build
build-eleventy:
stage: build-eleventy
stage: build
image: node:latest
cache:
paths:
@ -14,3 +15,14 @@ build-eleventy:
- _site/
only:
- master
docker_build:
stage: build
script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker build --pull -t $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG .
- docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
- docker tag $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG $CI_REGISTRY_IMAGE:latest
- docker push $CI_REGISTRY_IMAGE:latest
only:
- master