Skip to content

Commit

Permalink
Run CI only on version tags, not on other tags.
Browse files Browse the repository at this point in the history
  • Loading branch information
smarnach committed Dec 4, 2023
1 parent db6d473 commit cf994f2
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions .github/workflows/build-and-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ on:
branches:
- main
tags:
- '*'
- v[0-9]+.[0-9]+.[0-9]+
- v[0-9]+.[0-9]+.[0-9]+-[0-9]
pull_request:
branches:
- main
Expand Down Expand Up @@ -62,13 +63,8 @@ jobs:
if: startsWith(github.ref, 'refs/tags/')
run: |
echo IMAGE_TAG="$GITHUB_REF_NAME" >> "$GITHUB_ENV"
if [[ $GITHUB_REF_NAME =~ ^v[0-9]{4}.[0-9]{2}.[0-9]{2} ]]; then
# Version tags are deployed to prod.
echo DEPLOYMENT_ENV=prod >> "$GITHUB_ENV"
else
# Other tags are not deployed at all.
echo DEPLOYMENT_ENV="" >> "$GITHUB_ENV"
fi
# Version tags are deployed to prod.
echo DEPLOYMENT_ENV=prod >> "$GITHUB_ENV"
- name: Push the Docker image to GAR
if: env.IMAGE_TAG != ''
uses: mozilla-it/deploy-actions/docker-push@main
Expand Down

0 comments on commit cf994f2

Please sign in to comment.