From 79cb66b8e18a74db1918f941cfdd48b5eac59c9b Mon Sep 17 00:00:00 2001 From: Fried Hoeben Date: Sun, 12 Nov 2023 19:42:25 +0100 Subject: [PATCH] more targets --- .github/workflows/other-build-test.yml | 58 +++++++++++++++++++++----- 1 file changed, 47 insertions(+), 11 deletions(-) diff --git a/.github/workflows/other-build-test.yml b/.github/workflows/other-build-test.yml index d8dc78a..7fa9a5b 100644 --- a/.github/workflows/other-build-test.yml +++ b/.github/workflows/other-build-test.yml @@ -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 @@ -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 @@ -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)