mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-01-06 05:25:40 +00:00
Enable building and pushing image for release branches
Enable building and pushing image for release branches Signed-off-by: Wenkai Yin(尹文开) <yinw@vmware.com>
This commit is contained in:
4
.github/workflows/push.yml
vendored
4
.github/workflows/push.yml
vendored
@@ -2,7 +2,9 @@ name: Main CI
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ main ]
|
branches:
|
||||||
|
- 'main'
|
||||||
|
- 'release-**'
|
||||||
tags:
|
tags:
|
||||||
- '*'
|
- '*'
|
||||||
|
|
||||||
|
|||||||
@@ -56,26 +56,21 @@ elif [[ "$triggeredBy" == "tags" ]]; then
|
|||||||
TAG=$(echo $GITHUB_REF | cut -d / -f 3)
|
TAG=$(echo $GITHUB_REF | cut -d / -f 3)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$BRANCH" == "main" ]]; then
|
TAG_LATEST=false
|
||||||
VERSION="$BRANCH"
|
if [[ ! -z "$TAG" ]]; then
|
||||||
elif [[ ! -z "$TAG" ]]; then
|
echo "We're building tag $TAG"
|
||||||
|
VERSION="$TAG"
|
||||||
# Explicitly checkout tags when building from a git tag.
|
# Explicitly checkout tags when building from a git tag.
|
||||||
# This is not needed when building from main
|
# This is not needed when building from main
|
||||||
git fetch --tags
|
git fetch --tags
|
||||||
# Calculate the latest release if there's a tag.
|
# Calculate the latest release if there's a tag.
|
||||||
highest_release
|
highest_release
|
||||||
VERSION="$TAG"
|
if [[ "$TAG" == "$HIGHEST" ]]; then
|
||||||
|
TAG_LATEST=true
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
echo "We're not on main and we're not building a tag, exit early."
|
echo "We're on branch $BRANCH"
|
||||||
exit 0
|
VERSION="$BRANCH"
|
||||||
fi
|
|
||||||
|
|
||||||
# Assume we're not tagging `latest` by default, and never on main.
|
|
||||||
TAG_LATEST=false
|
|
||||||
if [[ "$BRANCH" == "main" ]]; then
|
|
||||||
echo "Building main, not tagging latest."
|
|
||||||
elif [[ "$TAG" == "$HIGHEST" ]]; then
|
|
||||||
TAG_LATEST=true
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -z "$BUILDX_PLATFORMS" ]]; then
|
if [[ -z "$BUILDX_PLATFORMS" ]]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user