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:
parent
56ef0a9b42
commit
1433a139cc
1 changed files with 4 additions and 9 deletions
|
@ -150,15 +150,10 @@ container:
|
||||||
DOCKER_BUILDKIT: 1
|
DOCKER_BUILDKIT: 1
|
||||||
dependencies: []
|
dependencies: []
|
||||||
stage: deploy
|
stage: deploy
|
||||||
|
only:
|
||||||
|
- master
|
||||||
before_script:
|
before_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
|
||||||
script:
|
script:
|
||||||
- docker build --target production -t $DEV_IMAGE_TAG .
|
- docker build --target production -t $DEV_IMAGE_TAG -t $PROD_IMAGE_TAG .
|
||||||
- docker push $DEV_IMAGE_TAG
|
- docker push $CI_REGISTRY_IMAGE
|
||||||
- >
|
|
||||||
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
|
|
||||||
|
|
Loading…
Reference in a new issue