Skip to content

Commit 1b1bd88

Browse files
committed
Add docker build workflow
1 parent 56092b8 commit 1b1bd88

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

.github/workflows/build.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,17 +104,17 @@ jobs:
104104
105105
- name: Docker tags
106106
run: |
107-
if [ -z "$DOCKER_METADATA_OUTPUT_VERSION" ]; then
108-
echo DOCKER_METADATA_OUTPUT_VERSION=${{ github.ref_name }} >> $GITHUB_ENV
109-
fi
110-
if [ -z "$DOCKER_METADATA_OUTPUT_JSON" ]; then
111-
echo DOCKER_METADATA_OUTPUT_JSON='{"tags":["${{ github.ref_name }}"]}' >> $GITHUB_ENV
107+
tags=$(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON")
108+
if [ -z "$tags" ]; then
109+
echo "DOCKER_METADATA_OUTPUT_VERSION=${{ github.ref_name }}" >> $GITHUB_ENV
110+
tags="-t ${{ github.ref_name }}"
112111
fi
112+
echo "DOCKER_METADATA_TAGS=$tags" >> $GITHUB_ENV
113113
114114
- name: Create manifest list and push
115115
working-directory: ${{ runner.temp }}/digests
116116
run: |
117-
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
117+
docker buildx imagetools create ${{ env.DOCKER_METADATA_TAGS }} \
118118
$(printf '${{ env.GITHUB_CR_REPO }}@sha256:%s ' *)
119119
120120
- name: Inspect image

0 commit comments

Comments
 (0)