mirror of
https://github.com/usememos/memos.git
synced 2025-03-11 04:53:02 +08:00
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.
This commit is contained in:
parent
edc3b578d6
commit
c9c40bc876
1 changed files with 6 additions and 6 deletions
|
@ -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…
Reference in a new issue