Unverified Commit c9c40bc8 authored by Andrew Williams's avatar Andrew Williams Committed by GitHub

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.
parent edc3b578
...@@ -2,9 +2,9 @@ name: build-and-push-release-image ...@@ -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: ...@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment