Only build container on master

It takes a long time, and most of the time doesn't change. CI should catch any potential issues
This commit is contained in:
Jake Howard 2022-09-13 08:59:56 +01:00
parent 56ef0a9b42
commit 1433a139cc
Signed by: jake
GPG Key ID: 57AFB45680EDD477

View File

@ -150,15 +150,10 @@ container:
DOCKER_BUILDKIT: 1
dependencies: []
stage: deploy
only:
- master
before_script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
script:
- docker build --target production -t $DEV_IMAGE_TAG .
- docker push $DEV_IMAGE_TAG
- >
if [ "$CI_COMMIT_REF_SLUG" == "master" ]; then
docker tag $DEV_IMAGE_TAG $PROD_IMAGE_TAG
docker push $PROD_IMAGE_TAG
else
echo "Not publishing container"
fi
- docker build --target production -t $DEV_IMAGE_TAG -t $PROD_IMAGE_TAG .
- docker push $CI_REGISTRY_IMAGE