Skip to content
17 changes: 11 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,7 @@ jobs:

- name: Build and upload to ghcr.io 📤
id: build-upload
# We need to pin exact version here, since updates can break
# the extract-image-names.sh script
uses: docker/[email protected]
uses: docker/[email protected]
with:
push: true
# Using provenance to disable default attestation so it will build only desired images:
Expand All @@ -77,6 +75,14 @@ jobs:
build.json
.github/workflows/env.hcl

# The metadata output is huge so we need to first write it to file
# https://github.com/aiidalab/aiidalab-docker-stack/issues/493
- name: Write metadata output to a json file
run: |
cat << EOF > bake_metadata.json
${{ steps.build-upload.outputs.metadata }}
EOF

- name: Set output variables
id: set-output
uses: actions/github-script@v8
Expand All @@ -91,7 +97,8 @@ jobs:
# "LAB_IMAGE":"ghcr.io/aiidalab/lab@sha256:e8c7b3a662660ad20fef7...",
# }
script: |
const bake_output = JSON.parse(process.env.BAKE_METADATA, 'utf-8');
const fs = require('fs');
const bake_output = JSON.parse(fs.readFileSync('bake_metadata.json', 'utf8'));
images = {};
for (const key in bake_output) {
const image = bake_output[key];
Expand All @@ -104,5 +111,3 @@ jobs:
}
console.log(images);
return images;
env:
BAKE_METADATA: ${{ steps.build-upload.outputs.metadata }}