mirror of
https://github.com/NoFxAiOS/nofx.git
synced 2026-07-17 01:14:40 +08:00
fix: only main branch should create latest docker tag
This commit is contained in:
5
.github/workflows/docker-build.yml
vendored
5
.github/workflows/docker-build.yml
vendored
@@ -163,11 +163,12 @@ jobs:
|
|||||||
"${GHCR_IMAGE}:${REF_NAME}-amd64" \
|
"${GHCR_IMAGE}:${REF_NAME}-amd64" \
|
||||||
"${GHCR_IMAGE}:${REF_NAME}-arm64"
|
"${GHCR_IMAGE}:${REF_NAME}-arm64"
|
||||||
|
|
||||||
if [[ "${{ github.ref }}" == "refs/heads/main" ]] || [[ "${{ github.ref }}" == "refs/heads/dev" ]]; then
|
# Only main branch gets the 'latest' tag (not dev)
|
||||||
|
if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then
|
||||||
docker buildx imagetools create -t "${GHCR_IMAGE}:latest" \
|
docker buildx imagetools create -t "${GHCR_IMAGE}:latest" \
|
||||||
"${GHCR_IMAGE}:${REF_NAME}-amd64" \
|
"${GHCR_IMAGE}:${REF_NAME}-amd64" \
|
||||||
"${GHCR_IMAGE}:${REF_NAME}-arm64"
|
"${GHCR_IMAGE}:${REF_NAME}-arm64"
|
||||||
echo "✅ Created latest tag"
|
echo "✅ Created latest tag (main branch only)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -n "${{ secrets.DOCKERHUB_USERNAME }}" ]]; then
|
if [[ -n "${{ secrets.DOCKERHUB_USERNAME }}" ]]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user