Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Jul 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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