From c9c40bc8761417cfc4ea92bc4f836cc59ac1f2ae Mon Sep 17 00:00:00 2001 From: Andrew Williams Date: Fri, 26 Jul 2024 03:36:34 +0100 Subject: [PATCH] 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. --- .github/workflows/build-and-push-release-image.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-and-push-release-image.yml b/.github/workflows/build-and-push-release-image.yml index 5643aa75..5f04291d 100644 --- a/.github/workflows/build-and-push-release-image.yml +++ b/.github/workflows/build-and-push-release-image.yml @@ -2,9 +2,9 @@ name: build-and-push-release-image on: push: - branches: - # Run on pushing branches like `release/1.0.0` - - "release/*.*.*" + tags: + # Run on pushing a tag in the format of 'v0.0.0' + - "v[0-9]+.[0-9]+.[0-9]+" jobs: build-and-push-release-image: @@ -19,10 +19,10 @@ jobs: uses: docker/setup-qemu-action@v3 - name: Extract build args - # Extract version from branch name - # Example: branch name `release/1.0.0` sets up env.VERSION=1.0.0 + # Extract version from tag name + # Example: tag name `v1.0.0` sets up env.VERSION=1.0.0 run: | - echo "VERSION=${GITHUB_REF_NAME#release/}" >> $GITHUB_ENV + echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_ENV - name: Login to Docker Hub uses: docker/login-action@v3