Skip to content

Commit c9fb506

Browse files
committed
chore: Add branch based image names
1 parent 7b00b6a commit c9fb506

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

‎.github/workflows/builder.yaml‎

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,20 @@ jobs:
8989
echo "build_arch=false" >> $GITHUB_OUTPUT;
9090
elif [[ "${{ steps.info.outputs.architectures }}" =~ ${{ matrix.arch }} ]]; then
9191
echo "build_arch=true" >> $GITHUB_OUTPUT;
92-
echo "image=$(echo ${{ steps.info.outputs.image }} | cut -d'/' -f3)" >> $GITHUB_OUTPUT;
92+
93+
# Determine image suffix based on branch
94+
if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then
95+
# Main branch: remove -canary suffix if present
96+
image_name=$(echo ${{ steps.info.outputs.image }} | cut -d'/' -f3 | sed 's/-canary$//')
97+
else
98+
# Other branches (including canary): keep -canary suffix
99+
image_name=$(echo ${{ steps.info.outputs.image }} | cut -d'/' -f3)
100+
if [[ ! "$image_name" =~ -canary$ ]]; then
101+
image_name="${image_name}-canary"
102+
fi
103+
fi
104+
105+
echo "image=$image_name" >> $GITHUB_OUTPUT;
93106
if [[ -z "${{ github.head_ref }}" ]] && [[ "${{ github.event_name }}" == "push" ]]; then
94107
echo "BUILD_ARGS=" >> $GITHUB_ENV;
95108
fi

0 commit comments

Comments
 (0)