Skip to content

Commit

Permalink
fix(gha): update docker bake step to use unmerged bake-files
Browse files Browse the repository at this point in the history
  • Loading branch information
iwilltry42 committed Jan 17, 2025
1 parent 37098f9 commit 2c779f2
Showing 1 changed file with 4 additions and 19 deletions.
23 changes: 4 additions & 19 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -154,31 +154,16 @@ jobs:
type=ref,event=branch
type=ref,event=pr
type=sha
- name: Merge Metadata Bake Definitions
run: |
INPUT=(${{ steps.meta-k3d-binary.outputs.bake-file }} ${{ steps.meta-k3d-dind.outputs.bake-file }} ${{ steps.meta-k3d-proxy.outputs.bake-file }} ${{ steps.meta-k3d-tools.outputs.bake-file }})
OUT_FILE=$GITHUB_WORKSPACE/bake-metadata.json
OUT_FILE_TMP=$GITHUB_WORKSPACE/bake-metadata-tmp.json
cat << EOF > $OUT_FILE
{
"target": {}
}
EOF

for file in "${INPUT[@]}"; do
cat $OUT_FILE > $OUT_FILE_TMP
jq -s '.[0] * .[1]' $OUT_FILE_TMP $file > $OUT_FILE
done

rm "$OUT_FILE_TMP"
# Build and Push container images
- name: Build Images
uses: docker/bake-action@v6
with:
files: |
./docker-bake.hcl
$GITHUB_WORKSPACE/bake-metadata.json
cwd://${{ steps.meta-k3d-binary.outputs.bake-file }}
cwd://${{ steps.meta-k3d-dind.outputs.bake-file }}
cwd://${{ steps.meta-k3d-proxy.outputs.bake-file }}
cwd://${{ steps.meta-k3d-tools.outputs.bake-file }}
targets: release
push: false
# Wait for tests to pass and push images (ONLY ON TAG)
Expand Down

0 comments on commit 2c779f2

Please sign in to comment.