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:
Wenkai Yin(尹文开)
2022-02-21 14:49:20 +08:00
parent f9f9c291f2
commit 212550c5a9
2 changed files with 10 additions and 9 deletions
+3 -1
View File
@@ -2,7 +2,9 @@ name: Main CI
on:
push:
branches: [ main ]
branches:
- 'main'
- 'release-**'
tags:
- '*'
+7 -8
View File
@@ -56,9 +56,8 @@ elif [[ "$triggeredBy" == "tags" ]]; then
TAG=$(echo $GITHUB_REF | cut -d / -f 3)
fi
if [[ "$BRANCH" == "main" ]]; then
VERSION="$BRANCH"
elif [[ ! -z "$TAG" ]]; then
if [[ ! -z "$TAG" ]]; then
echo "We're building tag $TAG"
# Explicitly checkout tags when building from a git tag.
# This is not needed when building from main
git fetch --tags
@@ -66,16 +65,16 @@ elif [[ ! -z "$TAG" ]]; then
highest_release
VERSION="$TAG"
else
echo "We're not on main and we're not building a tag, exit early."
exit 0
echo "We're on branch $BRANCH"
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
if [[ "$TAG" == "$HIGHEST" ]]; then
TAG_LATEST=true
else
echo "Building $BRANCH, not tagging latest"
fi
if [[ -z "$BUILDX_PLATFORMS" ]]; then