chore: build release containers from tags rather than branches (#3739)

Fixes #3645, currently the release containers are build from the release branches, which are created in preparation for a release. This causes some users with automated CI/CD to either deploy a pre-release version or be notified of a release version before it has actually been released. 

This change switches the workflow to be triggered by tags, which are created on the release version.
pull/3750/head
Andrew Williams 7 months ago committed by GitHub
parent edc3b578d6
commit c9c40bc876
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -2,9 +2,9 @@ name: build-and-push-release-image
on: on:
push: push:
branches: tags:
# Run on pushing branches like `release/1.0.0` # Run on pushing a tag in the format of 'v0.0.0'
- "release/*.*.*" - "v[0-9]+.[0-9]+.[0-9]+"
jobs: jobs:
build-and-push-release-image: build-and-push-release-image:
@ -19,10 +19,10 @@ jobs:
uses: docker/setup-qemu-action@v3 uses: docker/setup-qemu-action@v3
- name: Extract build args - name: Extract build args
# Extract version from branch name # Extract version from tag name
# Example: branch name `release/1.0.0` sets up env.VERSION=1.0.0 # Example: tag name `v1.0.0` sets up env.VERSION=1.0.0
run: | run: |
echo "VERSION=${GITHUB_REF_NAME#release/}" >> $GITHUB_ENV echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_ENV
- name: Login to Docker Hub - name: Login to Docker Hub
uses: docker/login-action@v3 uses: docker/login-action@v3

Loading…
Cancel
Save