Updated gitlab-ci.yml to remove images after push and build

This commit is contained in:
Matthew McKinnon 2022-08-07 15:45:15 +10:00
parent 1484d4e01f
commit 22a92f7525

View File

@ -13,6 +13,7 @@ build-eleventy:
paths: paths:
- node_modules/ - node_modules/
script: script:
- npm install - npm install
- npm run build - npm run build
artifacts: artifacts:
@ -27,7 +28,6 @@ docker-build:
stage: docker-build stage: docker-build
image: docker:latest image: docker:latest
script: script:
- docker rmi $IMAGE_TAG $IMAGE_TAG_LATEST
- 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 --no-cache --pull -t $IMAGE_TAG . - docker build --no-cache --pull -t $IMAGE_TAG .
- docker push $IMAGE_TAG - docker push $IMAGE_TAG