Skip to content

Commit

Permalink
more targets
Browse files Browse the repository at this point in the history
  • Loading branch information
fhoeben committed Nov 12, 2023
1 parent 13423ef commit 79cb66b
Showing 1 changed file with 47 additions and 11 deletions.
58 changes: 47 additions & 11 deletions .github/workflows/other-build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,23 +55,44 @@ jobs:
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build
id: bake
id: bake-test
uses: docker/bake-action@v4
with:
files: |
./docker-bake.hcl
/tmp/bake-meta.json
targets: ${{ env.TARGET_NAME }}
targets: |
test
chrome
combine
test-with-pdf
chrome-with-pdf
set: |
*.tags=
*.platform=${{ matrix.platform }}
*.output=type=image,"name=${{ env.REGISTRY_IMAGE }}",push-by-digest=true,name-canonical=true,push=true
test.output=type=image,"name=hsac/fitnesse-fixtures-test-jre11",push-by-digest=true,name-canonical=true,push=true
combine.output=type=image,"name=hsac/fitnesse-fixtures-combine",push-by-digest=true,name-canonical=true,push=true
chrome.output=type=image,"name=hsac/fitnesse-fixtures-test-jre11-chrome",push-by-digest=true,name-canonical=true,push=true
test-with-pdf.output=type=image,"name=hsac/fitnesse-fixtures-test-jre11-with-pdf",push-by-digest=true,name-canonical=true,push=true
chrome-with-pdf.output=type=image,"name=hsac/fitnesse-fixtures-test-jre11-chrome-with-pdf",push-by-digest=true,name-canonical=true,push=true
- name: Export digest
- name: Export digests
run: |
mkdir -p /tmp/digests
digest="${{ fromJSON(steps.bake.outputs.metadata)[env.TARGET_NAME]['containerimage.digest'] }}"
touch "/tmp/digests/${digest#sha256:}"
mkdir -p /tmp/digests/test
test-digest="${{ fromJSON(steps.bake.outputs.metadata)['test']['containerimage.digest'] }}"
touch "/tmp/digests/test/${test-digest#sha256:}"
mkdir -p /tmp/digests/combine
combine-digest="${{ fromJSON(steps.bake.outputs.metadata)['combine']['containerimage.digest'] }}"
touch "/tmp/digests/combine/${combine-digest#sha256:}"
mkdir -p /tmp/digests/chrome
chrome-digest="${{ fromJSON(steps.bake.outputs.metadata)['chrome']['containerimage.digest'] }}"
touch "/tmp/digests/chrome/${chrome-digest#sha256:}"
mkdir -p /tmp/digests/test-with-pdf
test-with-pdf-digest="${{ fromJSON(steps.bake.outputs.metadata)['test-with-pdf']['containerimage.digest'] }}"
touch "/tmp/digests/test-with-pdf/${test-with-pdf-digest#sha256:}"
mkdir -p /tmp/digests/chrome-with-pdf
chrome-with-pdf-digest="${{ fromJSON(steps.bake.outputs.metadata)['chrome-with-pdf']['containerimage.digest'] }}"
touch "/tmp/digests/chrome-with-pdf/${chrome-with-pdf-digest#sha256:}"
- name: Upload digest
uses: actions/upload-artifact@v3
Expand All @@ -85,6 +106,21 @@ jobs:
runs-on: ubuntu-latest
needs:
- build
strategy:
fail-fast: false
matrix:
target: [test, combine, chrome, test-with-pdf, chrome-with-pdf]
include:
- target: test
image: hsac/fitnesse-fixtures-test-jre11
- target: combine
image: hsac/fitnesse-fixtures-combine
- target: chrome
image: hsac/fitnesse-fixtures-test-jre11-chrome
- target: test-with-pdf
image: hsac/fitnesse-fixtures-test-jre11-with-pdf
- target: chrome-with-pdf
image: hsac/fitnesse-fixtures-test-jre11-chrome-with-pdf
steps:
- name: Download meta bake definition
uses: actions/download-artifact@v3
Expand All @@ -108,11 +144,11 @@ jobs:
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Create manifest list and push
working-directory: /tmp/digests
working-directory: /tmp/digests/${{ matrix.target }}
run: |
docker buildx imagetools create $(jq -cr '.target."docker-metadata-action".tags | map(select(startswith("${{ env.REGISTRY_IMAGE }}")) | "-t " + .) | join(" ")' /tmp/bake-meta.json) \
$(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *)
docker buildx imagetools create $(jq -cr '.target."docker-metadata-action".tags | map(select(startswith("${{ matrix.image }}")) | "-t " + .) | join(" ")' /tmp/bake-meta.json) \
$(printf '${{ matrix.image }}@sha256:%s ' *)
- name: Inspect image
run: |
docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:$(jq -r '.target."docker-metadata-action".args.DOCKER_META_VERSION' /tmp/bake-meta.json)
docker buildx imagetools inspect ${{ matrix.image }}:$(jq -r '.target."docker-metadata-action".args.DOCKER_META_VERSION' /tmp/bake-meta.json)

0 comments on commit 79cb66b

Please sign in to comment.