From 28c00505ab6b2b94e9492679116e52d98db13c1a Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Thu, 18 Apr 2024 19:17:53 +0100 Subject: [PATCH] Use digest to identify image --- .github/workflows/build.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cd8fb5cd..171e3131 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -87,12 +87,12 @@ jobs: - name: Set output variables id: bake_metadata + env: + BAKE_META: ${{ steps.build-amd64.outputs.metadata }} + # TODO: Make this into a shell script run: | - cat docker-bake-template-meta.json \ - | jq -c '.target | [to_entries[] | {"key": (.key|split("-")[:-1] | join("-")), "value": [.value.tags[]][1]}] | from_entries' \ - | tee bake-meta.json - targets=$(echo $(cat bake-meta.json | jq -c 'keys')) - images=$(echo $(cat bake-meta.json | jq -c '. | [to_entries[] | {"key": (.key| split("-")| join("_") |ascii_upcase + "_IMAGE"), "value": .value}] | from_entries')) + targets=$(echo "${BAKE_META}"| jq -c 'keys') + images=$(echo "${BAKE_META}"| jq -c '. as $base |[to_entries[] |{"key": (.key|ascii_upcase|sub("-"; "_"; "g") + "_IMAGE"), "value": [(.value."image.name"|split(",")[0]),.value."containerimage.digest"]|join("@")}] |from_entries') echo -e "targets=$targets\nimages=$images" echo "targets=$targets" >> "${GITHUB_OUTPUT}" echo "images=$images" >> "${GITHUB_OUTPUT}"