Skip to content

Commit

Permalink
chore: build release containers from tags rather than branches (#3739)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
nikdoof authored Jul 26, 2024
1 parent edc3b57 commit c9c40bc
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/build-and-push-release-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down

0 comments on commit c9c40bc

Please sign in to comment.