Skip to content

Commit 519afd4

Browse files
authored
Set tags correctly for release workflow (#890)
We switched from manually executing `docker buildx bake` to using the docker metadata and build-push action. These don't support the format we were using and only the first tag was published. Signed-off-by: Brian Goff <[email protected]>
1 parent db611f4 commit 519afd4

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

.github/workflows/frontend-image.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ on:
1515
tag:
1616
description: 'Tag to publish'
1717
required: true
18-
default: 'latest'
18+
default: 'type=raw,value=latest'
1919

2020
permissions:
2121
contents: read

.github/workflows/release.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,23 @@ jobs:
3333
# Remove leading "v" from tag name
3434
TRIMMED_REF_NAME="${REF_NAME#v}"
3535
36-
# Creates a comma separated list of tags
37-
# - <major>.<minor>
38-
# - <major>.<minor>.<patch>
39-
OUTPUT_TAGS="${TRIMMED_REF_NAME%.*},${TRIMMED_REF_NAME}"
36+
OUTPUT_TAGS=(
37+
"type=raw,value=${TRIMMED_REF_NAME%.*}"
38+
"type=raw,value=${TRIMMED_REF_NAME}"
39+
)
4040
4141
# Check if this tag is the latest release by fetching the latest release and comparing the tag to the tag being built.
4242
LATEST_TAG="$(gh release view --json tagName -q .tagName)"
4343
if [ "$REF_NAME" = "$LATEST_TAG" ]; then
44-
OUTPUT_TAGS="latest,${OUTPUT_TAGS}"
44+
OUTPUT_TAGS=("type=raw,value=latest" "${OUTPUT_TAGS[@]}")
4545
fi
4646
47-
echo "OUTPUT_TAGS=${OUTPUT_TAGS}" >> "$GITHUB_OUTPUT" && cat "$GITHUB_OUTPUT"
47+
{
48+
echo "OUTPUT_TAGS<<EOF"
49+
printf '%s\n' "${OUTPUT_TAGS[@]}"
50+
echo "EOF"
51+
} >> "$GITHUB_OUTPUT"
52+
cat "$GITHUB_OUTPUT"
4853
env:
4954
REF_NAME: ${{ github.ref_name }}
5055
GH_TOKEN: ${{ github.token }}

.github/workflows/worker-images.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ jobs:
182182
fi
183183
184184
echo "digest=${DIGEST}" >> $GITHUB_OUTPUT
185-
echo "image-name=ghcr.io/${BASE_REPO}" >> $GITHUB_OUTPUT
185+
echo "image-name=ghcr.io/${BASE_REPO}" >> $GITHUB_OUTPUT
186186
- name: Attest build provenance
187187
if: ${{ (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) || github.event_name == 'workflow_dispatch' }}
188188
uses: actions/attest-build-provenance@ef244123eb79f2f7a7e75d99086184180e6d0018 # v2.0.0

0 commit comments

Comments
 (0)