Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] authored and unkcpz committed Apr 23, 2023
1 parent f8efe40 commit 23138b7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ jobs:
type=ref,event=pr
type=raw,value={{tag}},enable=${{ github.ref_type == 'tag' && ! startsWith(github.ref_name, 'v') }}
type=match,pattern=v(\d{4}\.\d{4}(-.+)?),group=1
type=sha
- name: Generate docker-bake meta file.
env:
BAKE_TEMPLATE_META: ${{ steps.meta.outputs.bake-file }}
Expand All @@ -79,9 +80,13 @@ jobs:
env:
BAKE_TEMPLATE_META: ${{ steps.meta.outputs.bake-file }}
run: |
targets = $(echo ${BAKE_TEMPLATE_META} | jq -c '.target | [to_entries[] | {"key": (.key|split("-")[:-1] | join("-"))}] | from_entries | keys')
cat ${BAKE_TEMPLATE_META} | jq -c \
| .github/workflows/merge-bake-template-target.sh \
| 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'))
echo "targets=$targets" >> "${GITHUB_OUTPUT}"
images=$(echo $(BAKE_TEMPLATE_META) | jq -c '.target | [to_entries[] | {"key": (.key|split("-")[:-1] | join("-") | ascii_upcase | sub("-"; "_"; "g") + "_IMAGE"), "value": [.value.tags[], .value.labels."org.opencontainers.image.revision"] | join("@")}] | from_entries'
images=$(echo $(cat bake-meta.json | jq -c '. | [to_entries[] | {"key": (.key|ascii_upcase + "_IMAGE"), "value": .value}] | from_entries'))
echo "images=$images" >> "${GITHUB_OUTPUT}"
test:
Expand Down
2 changes: 1 addition & 1 deletion bake-meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -327,4 +327,4 @@
"containerimage.digest": "sha256:01bb6d4555aad95fc571d5d584a045608f19ec238b6b11012c904976e998f002",
"image.name": "ghcr.io/aiidalab/lab:pr-372"
}
}
}
2 changes: 1 addition & 1 deletion bake-temp-meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,4 @@
}
}
}
}
}

0 comments on commit 23138b7

Please sign in to comment.