Merge branch 'docker-release-only' into 'develop'

GitLab CI: only run Docker job when a tag is pushed

See merge request soapbox-pub/soapbox!2299
This commit is contained in:
Alex Gleason 2023-02-21 17:10:07 +00:00
commit 6a3618da9a

View file

@ -157,11 +157,11 @@ docker:
# https://medium.com/devops-with-valentine/how-to-build-a-docker-image-and-push-it-to-the-gitlab-container-registry-from-a-gitlab-ci-pipeline-acac0d1f26df # https://medium.com/devops-with-valentine/how-to-build-a-docker-image-and-push-it-to-the-gitlab-container-registry-from-a-gitlab-ci-pipeline-acac0d1f26df
script: script:
- echo $CI_REGISTRY_PASSWORD | docker login -u $CI_REGISTRY_USER $CI_REGISTRY --password-stdin - echo $CI_REGISTRY_PASSWORD | docker login -u $CI_REGISTRY_USER $CI_REGISTRY --password-stdin
- docker build -t $CI_REGISTRY_IMAGE . - docker build -t $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG .
- docker push $CI_REGISTRY_IMAGE - docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG
only: rules:
variables: - if: $CI_COMMIT_TAG
- $CI_DEFAULT_BRANCH == $CI_COMMIT_REF_NAME interruptible: false
release: release:
stage: release stage: release