Repository navigation
chore(deps): update Buildx version to v0.39.1 #723
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: .test-build | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - 'main' | |
| - 'releases/v*' | |
| paths: | |
| - '.github/workflows/.test-build.yml' | |
| - '.github/workflows/build.yml' | |
| - '.github/workflows/setup-registry-identities.yml' | |
| - '.github/workflows/verify.yml' | |
| - 'test/**' | |
| pull_request: | |
| paths: | |
| - '.github/workflows/.test-build.yml' | |
| - '.github/workflows/build.yml' | |
| - '.github/workflows/setup-registry-identities.yml' | |
| - '.github/workflows/verify.yml' | |
| - 'test/**' | |
| jobs: | |
| build-dockerhub-single: | |
| uses: ./.github/workflows/build.yml | |
| permissions: | |
| contents: read | |
| id-token: write | |
| with: | |
| job-name-prefix: build-dockerhub-single | |
| build-args: | | |
| VERSION={{meta.version}} | |
| cache: true | |
| cache-scope: build-dockerhub-single | |
| file: test/hello.Dockerfile | |
| output: image | |
| push: ${{ github.event_name != 'pull_request' }} | |
| sbom: true | |
| registry-identities: | | |
| - type: dockerhub | |
| registry: docker.io | |
| username: ${{ vars.DOCKERHUB_OIDC_USERNAME }} | |
| connection_id: ${{ vars.DOCKERHUB_OIDC_CONNECTIONID }} | |
| expires_in: 7200 | |
| meta-images: | | |
| docker.io/dockereng/github-builder-test | |
| meta-tags: | | |
| type=raw,value=build-ghbuilder-single-${{ github.run_id }} | |
| build-dockerhub-single-verify: | |
| uses: ./.github/workflows/verify.yml | |
| if: ${{ github.event_name != 'pull_request' }} | |
| needs: | |
| - build-dockerhub-single | |
| permissions: | |
| contents: read | |
| id-token: write | |
| with: | |
| builder-outputs: ${{ toJSON(needs.build-dockerhub-single.outputs) }} | |
| registry-identities: | | |
| - type: dockerhub | |
| registry: docker.io | |
| username: ${{ vars.DOCKERHUB_OIDC_USERNAME }} | |
| connection_id: ${{ vars.DOCKERHUB_OIDC_CONNECTIONID }} | |
| expires_in: 7200 | |
| build-dockerhub-single-outputs: | |
| runs-on: ubuntu-26.04 | |
| needs: | |
| - build-dockerhub-single | |
| steps: | |
| - | |
| name: Builder outputs | |
| uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 | |
| env: | |
| INPUT_BUILDER-OUTPUTS: ${{ toJSON(needs.build-dockerhub-single.outputs) }} | |
| with: | |
| script: | | |
| const builderOutputs = JSON.parse(core.getInput('builder-outputs')); | |
| core.info(JSON.stringify(builderOutputs, null, 2)); | |
| build-proxy-network: | |
| uses: ./.github/workflows/build.yml | |
| permissions: | |
| contents: read | |
| with: | |
| cache: true | |
| cache-scope: build-proxynettest | |
| file: test/proxy-network.Dockerfile | |
| output: local | |
| buildkit-proxy-network: true | |
| build-ecr-public: | |
| uses: ./.github/workflows/build.yml | |
| if: ${{ github.event_name != 'pull_request' }} | |
| permissions: | |
| contents: read | |
| id-token: write | |
| with: | |
| build-args: | | |
| VERSION={{meta.version}} | |
| file: test/hello.Dockerfile | |
| output: image | |
| push: true | |
| sbom: true | |
| registry-identities: | | |
| - type: aws-ecr | |
| registry: public.ecr.aws | |
| role-to-assume: arn:aws:iam::175142243308:role/official_gha_cicd | |
| region: us-east-1 | |
| meta-images: | | |
| public.ecr.aws/q3b5f1u4/test-docker-action | |
| meta-tags: | | |
| type=raw,value=build-ecr-public-${{ github.run_id }} | |
| build-ecr-private: | |
| uses: ./.github/workflows/build.yml | |
| if: ${{ github.event_name != 'pull_request' }} | |
| permissions: | |
| contents: read | |
| id-token: write | |
| with: | |
| build-args: | | |
| VERSION={{meta.version}} | |
| file: test/hello.Dockerfile | |
| output: image | |
| push: true | |
| sbom: true | |
| registry-identities: | | |
| - type: aws-ecr | |
| registry: 175142243308.dkr.ecr.us-east-2.amazonaws.com | |
| role-to-assume: arn:aws:iam::175142243308:role/official_gha_cicd | |
| region: us-east-1 | |
| meta-images: | | |
| 175142243308.dkr.ecr.us-east-2.amazonaws.com/sandbox/test-docker-action | |
| meta-tags: | | |
| type=raw,value=build-ecr-private-${{ github.run_id }} | |
| build-dockerhub: | |
| uses: ./.github/workflows/build.yml | |
| permissions: | |
| contents: read | |
| id-token: write | |
| with: | |
| build-args: | | |
| VERSION={{meta.version}} | |
| cache: true | |
| cache-scope: build-dockerhub | |
| file: test/hello.Dockerfile | |
| output: image | |
| platforms: linux/amd64,linux/arm64 | |
| push: ${{ github.event_name != 'pull_request' }} | |
| runner: | | |
| default=ubuntu-26.04 | |
| linux/arm=ubuntu-26.04-arm | |
| linux/arm64=ubuntu-26.04-arm | |
| sbom: true | |
| registry-identities: | | |
| - type: dockerhub | |
| registry: docker.io | |
| username: ${{ vars.DOCKERHUB_OIDC_USERNAME }} | |
| connection_id: ${{ vars.DOCKERHUB_OIDC_CONNECTIONID }} | |
| meta-images: | | |
| docker.io/dockereng/github-builder-test | |
| meta-tags: | | |
| type=raw,value=build-ghbuilder-${{ github.run_id }} | |
| build-dockerhub-verify: | |
| uses: ./.github/workflows/verify.yml | |
| if: ${{ github.event_name != 'pull_request' }} | |
| needs: | |
| - build-dockerhub | |
| permissions: | |
| contents: read | |
| id-token: write | |
| with: | |
| builder-outputs: ${{ toJSON(needs.build-dockerhub.outputs) }} | |
| registry-identities: | | |
| - type: dockerhub | |
| registry: docker.io | |
| username: ${{ vars.DOCKERHUB_OIDC_USERNAME }} | |
| connection_id: ${{ vars.DOCKERHUB_OIDC_CONNECTIONID }} | |
| build-dockerhub-outputs: | |
| runs-on: ubuntu-26.04 | |
| needs: | |
| - build-dockerhub | |
| steps: | |
| - | |
| name: Builder outputs | |
| uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 | |
| env: | |
| INPUT_BUILDER-OUTPUTS: ${{ toJSON(needs.build-dockerhub.outputs) }} | |
| with: | |
| script: | | |
| const builderOutputs = JSON.parse(core.getInput('builder-outputs')); | |
| core.info(JSON.stringify(builderOutputs, null, 2)); | |
| build-dockerhub-scan: | |
| runs-on: ubuntu-26.04 | |
| if: ${{ github.event_name != 'pull_request' }} | |
| needs: | |
| - build-dockerhub | |
| steps: | |
| - | |
| name: Scan for vulnerabilities | |
| uses: crazy-max/ghaction-container-scan@ffcba8deb5cb3531954cbedbbcd0179d79edf510 # v4.1.0 | |
| with: | |
| image: docker.io/dockereng/github-builder-test@${{ needs.build-dockerhub.outputs.digest }} | |
| build-dockerhub-nosign: | |
| uses: ./.github/workflows/build.yml | |
| permissions: | |
| contents: read | |
| id-token: write | |
| with: | |
| build-args: | | |
| VERSION={{meta.version}} | |
| cache: true | |
| cache-scope: build-dockerhub-nosign | |
| file: test/hello.Dockerfile | |
| output: image | |
| platforms: linux/amd64,linux/arm64 | |
| push: ${{ github.event_name != 'pull_request' }} | |
| sbom: true | |
| sign: false | |
| registry-identities: | | |
| - type: dockerhub | |
| registry: docker.io | |
| username: ${{ vars.DOCKERHUB_OIDC_USERNAME }} | |
| connection_id: ${{ vars.DOCKERHUB_OIDC_CONNECTIONID }} | |
| meta-images: | | |
| docker.io/dockereng/github-builder-test | |
| meta-tags: | | |
| type=raw,value=build-ghbuilder-nosign--${{ github.run_id }} | |
| build-dockerhub-nosign-verify: | |
| uses: ./.github/workflows/verify.yml | |
| if: ${{ github.event_name != 'pull_request' }} | |
| needs: | |
| - build-dockerhub-nosign | |
| with: | |
| builder-outputs: ${{ toJSON(needs.build-dockerhub-nosign.outputs) }} | |
| build-dockerhub-nosign-outputs: | |
| runs-on: ubuntu-26.04 | |
| needs: | |
| - build-dockerhub-nosign | |
| steps: | |
| - | |
| name: Builder outputs | |
| uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 | |
| env: | |
| INPUT_BUILDER-OUTPUTS: ${{ toJSON(needs.build-dockerhub-nosign.outputs) }} | |
| with: | |
| script: | | |
| const builderOutputs = JSON.parse(core.getInput('builder-outputs')); | |
| core.info(JSON.stringify(builderOutputs, null, 2)); | |
| build-ghcr: | |
| uses: ./.github/workflows/build.yml | |
| permissions: | |
| contents: read | |
| id-token: write | |
| packages: write | |
| with: | |
| build-args: | | |
| VERSION={{meta.version}} | |
| file: test/hello.Dockerfile | |
| output: image | |
| platforms: linux/amd64,linux/arm64 | |
| push: ${{ github.event_name != 'pull_request' }} | |
| sbom: true | |
| meta-images: ghcr.io/docker/github-builder-test | |
| meta-tags: | | |
| type=raw,value=build-${{ github.run_id }} | |
| secrets: | |
| registry-auths: | | |
| - registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| build-ghcr-verify: | |
| uses: ./.github/workflows/verify.yml | |
| if: ${{ github.event_name != 'pull_request' }} | |
| needs: | |
| - build-ghcr | |
| with: | |
| builder-outputs: ${{ toJSON(needs.build-ghcr.outputs) }} | |
| secrets: | |
| registry-auths: | | |
| - registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| build-ghcr-outputs: | |
| runs-on: ubuntu-26.04 | |
| needs: | |
| - build-ghcr | |
| steps: | |
| - | |
| name: Builder outputs | |
| uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 | |
| env: | |
| INPUT_BUILDER-OUTPUTS: ${{ toJSON(needs.build-ghcr.outputs) }} | |
| with: | |
| script: | | |
| const builderOutputs = JSON.parse(core.getInput('builder-outputs')); | |
| core.info(JSON.stringify(builderOutputs, null, 2)); | |
| build-ghcr-and-dockerhub: | |
| uses: ./.github/workflows/build.yml | |
| permissions: | |
| contents: read | |
| id-token: write | |
| packages: write | |
| with: | |
| build-args: | | |
| VERSION={{meta.version}} | |
| file: test/hello.Dockerfile | |
| output: image | |
| platforms: linux/amd64,linux/arm64 | |
| push: ${{ github.event_name != 'pull_request' }} | |
| sbom: true | |
| meta-images: | | |
| ghcr.io/docker/github-builder-test | |
| docker.io/dockereng/github-builder-test | |
| meta-tags: | | |
| type=raw,value=${{ github.run_id }},prefix=build-ghcr-and-dockerhub- | |
| registry-identities: | | |
| - type: dockerhub | |
| registry: docker.io | |
| username: ${{ vars.DOCKERHUB_OIDC_USERNAME }} | |
| connection_id: ${{ vars.DOCKERHUB_OIDC_CONNECTIONID }} | |
| secrets: | |
| registry-auths: | | |
| - registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| build-ghcr-and-dockerhub-verify: | |
| uses: ./.github/workflows/verify.yml | |
| if: ${{ github.event_name != 'pull_request' }} | |
| needs: | |
| - build-ghcr-and-dockerhub | |
| permissions: | |
| contents: read | |
| id-token: write | |
| with: | |
| builder-outputs: ${{ toJSON(needs.build-ghcr-and-dockerhub.outputs) }} | |
| registry-identities: | | |
| - type: dockerhub | |
| registry: docker.io | |
| username: ${{ vars.DOCKERHUB_OIDC_USERNAME }} | |
| connection_id: ${{ vars.DOCKERHUB_OIDC_CONNECTIONID }} | |
| secrets: | |
| registry-auths: | | |
| - registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| build-ghcr-and-dockerhub-outputs: | |
| runs-on: ubuntu-26.04 | |
| needs: | |
| - build-ghcr-and-dockerhub | |
| steps: | |
| - | |
| name: Builder outputs | |
| uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 | |
| env: | |
| INPUT_BUILDER-OUTPUTS: ${{ toJSON(needs.build-ghcr-and-dockerhub.outputs) }} | |
| with: | |
| script: | | |
| const builderOutputs = JSON.parse(core.getInput('builder-outputs')); | |
| core.info(JSON.stringify(builderOutputs, null, 2)); | |
| build-local: | |
| uses: ./.github/workflows/build.yml | |
| permissions: | |
| contents: read | |
| id-token: write | |
| with: | |
| artifact-name: build-output | |
| artifact-upload: true | |
| artifact-retention-days: 1 | |
| file: test/hello.Dockerfile | |
| output: local | |
| platforms: linux/amd64,linux/arm64 | |
| sbom: true | |
| sign: ${{ github.event_name != 'pull_request' }} | |
| build-local-verify: | |
| uses: ./.github/workflows/verify.yml | |
| if: ${{ github.event_name != 'pull_request' }} | |
| needs: | |
| - build-local | |
| with: | |
| builder-outputs: ${{ toJSON(needs.build-local.outputs) }} | |
| build-local-outputs: | |
| runs-on: ubuntu-26.04 | |
| needs: | |
| - build-local | |
| steps: | |
| - | |
| name: Builder outputs | |
| uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 | |
| env: | |
| INPUT_BUILDER-OUTPUTS: ${{ toJSON(needs.build-local.outputs) }} | |
| with: | |
| script: | | |
| const builderOutputs = JSON.parse(core.getInput('builder-outputs')); | |
| core.info(JSON.stringify(builderOutputs, null, 2)); | |
| build-local-single: | |
| uses: ./.github/workflows/build.yml | |
| permissions: | |
| contents: read | |
| id-token: write | |
| with: | |
| artifact-name: build-single-output | |
| artifact-upload: true | |
| file: test/hello.Dockerfile | |
| output: local | |
| sbom: true | |
| sign: ${{ github.event_name != 'pull_request' }} | |
| build-local-single-verify: | |
| uses: ./.github/workflows/verify.yml | |
| if: ${{ github.event_name != 'pull_request' }} | |
| needs: | |
| - build-local-single | |
| with: | |
| builder-outputs: ${{ toJSON(needs.build-local-single.outputs) }} | |
| build-local-single-outputs: | |
| runs-on: ubuntu-26.04 | |
| needs: | |
| - build-local-single | |
| steps: | |
| - | |
| name: Builder outputs | |
| uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 | |
| env: | |
| INPUT_BUILDER-OUTPUTS: ${{ toJSON(needs.build-local-single.outputs) }} | |
| with: | |
| script: | | |
| const builderOutputs = JSON.parse(core.getInput('builder-outputs')); | |
| core.info(JSON.stringify(builderOutputs, null, 2)); | |
| build-local-noupload: | |
| uses: ./.github/workflows/build.yml | |
| permissions: | |
| contents: read | |
| id-token: write | |
| with: | |
| artifact-upload: false | |
| file: test/hello.Dockerfile | |
| output: local | |
| platforms: linux/amd64,linux/arm64 | |
| sbom: true | |
| build-local-noupload-verify: | |
| uses: ./.github/workflows/verify.yml | |
| needs: | |
| - build-local-noupload | |
| with: | |
| builder-outputs: ${{ toJSON(needs.build-local-noupload.outputs) }} | |
| build-local-noupload-outputs: | |
| runs-on: ubuntu-26.04 | |
| needs: | |
| - build-local-noupload | |
| steps: | |
| - | |
| name: Builder outputs | |
| uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 | |
| env: | |
| INPUT_BUILDER-OUTPUTS: ${{ toJSON(needs.build-local-noupload.outputs) }} | |
| with: | |
| script: | | |
| const builderOutputs = JSON.parse(core.getInput('builder-outputs')); | |
| core.info(JSON.stringify(builderOutputs, null, 2)); | |
| build-local-nosign: | |
| uses: ./.github/workflows/build.yml | |
| permissions: | |
| contents: read | |
| id-token: write | |
| with: | |
| artifact-name: build-nosign-output | |
| artifact-upload: true | |
| file: test/hello.Dockerfile | |
| output: local | |
| platforms: linux/amd64,linux/arm64 | |
| sbom: true | |
| sign: false | |
| build-local-nosign-verify: | |
| uses: ./.github/workflows/verify.yml | |
| needs: | |
| - build-local-nosign | |
| with: | |
| builder-outputs: ${{ toJSON(needs.build-local-nosign.outputs) }} | |
| build-local-nosign-outputs: | |
| runs-on: ubuntu-26.04 | |
| needs: | |
| - build-local-nosign | |
| steps: | |
| - | |
| name: Builder outputs | |
| uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 | |
| env: | |
| INPUT_BUILDER-OUTPUTS: ${{ toJSON(needs.build-local-nosign.outputs) }} | |
| with: | |
| script: | | |
| const builderOutputs = JSON.parse(core.getInput('builder-outputs')); | |
| core.info(JSON.stringify(builderOutputs, null, 2)); | |
| build-secret: | |
| uses: ./.github/workflows/build.yml | |
| permissions: | |
| contents: read | |
| id-token: write | |
| with: | |
| artifact-upload: false | |
| file: test/secret.Dockerfile | |
| output: local | |
| secrets: | |
| build-secrets: |+ | |
| fixture.plain: | | |
| alpha-line | |
| beta-line | |
| fixture.json: ${{ toJSON(format('gamma-line{0}delta-line{0}', fromJSON('"\n"'))) }} | |
| fixture_fuu: standard-secret | |
| fixture_keep: |+ | |
| keep-line | |
| build-set-runner: | |
| uses: ./.github/workflows/build.yml | |
| permissions: | |
| contents: read | |
| id-token: write | |
| with: | |
| runner: ubuntu-26.04 | |
| build-args: | | |
| VERSION={{meta.version}} | |
| file: test/hello.Dockerfile | |
| output: image | |
| platforms: linux/amd64,linux/arm64 | |
| push: false | |
| registry-identities: | | |
| - type: dockerhub | |
| username: ${{ vars.DOCKERHUB_OIDC_USERNAME }} | |
| connection_id: ${{ vars.MISSING_DOCKERHUB_OIDC_CONNECTIONID }} | |
| meta-images: ghcr.io/docker/github-builder-test | |
| meta-tags: | | |
| type=raw,value=build-${{ github.run_id }} | |
| build-set-runner-deprecated: | |
| uses: ./.github/workflows/build.yml | |
| permissions: | |
| contents: read | |
| id-token: write | |
| with: | |
| runner: amd64 | |
| build-args: | | |
| VERSION={{meta.version}} | |
| file: test/hello.Dockerfile | |
| output: image | |
| platforms: linux/amd64,linux/arm64 | |
| push: false | |
| meta-images: ghcr.io/docker/github-builder-test | |
| meta-tags: | | |
| type=raw,value=build-${{ github.run_id }} | |
| build-qemu: | |
| uses: ./.github/workflows/build.yml | |
| permissions: | |
| contents: read | |
| id-token: write | |
| with: | |
| setup-qemu: true | |
| artifact-upload: false | |
| file: test/hello.Dockerfile | |
| output: local | |
| platforms: linux/amd64,linux/arm64 | |
| sbom: true | |
| build-dockerhub-nodistrib: | |
| uses: ./.github/workflows/build.yml | |
| permissions: | |
| contents: read | |
| id-token: write | |
| with: | |
| distribute: false | |
| build-args: | | |
| VERSION={{meta.version}} | |
| cache: true | |
| cache-scope: build-dockerhub-nodistrib | |
| file: test/hello.Dockerfile | |
| output: image | |
| platforms: linux/amd64,linux/arm64 | |
| push: ${{ github.event_name != 'pull_request' }} | |
| sbom: true | |
| registry-identities: | | |
| - type: dockerhub | |
| registry: docker.io | |
| username: ${{ vars.DOCKERHUB_OIDC_USERNAME }} | |
| connection_id: ${{ vars.DOCKERHUB_OIDC_CONNECTIONID }} | |
| meta-images: | | |
| docker.io/dockereng/github-builder-test | |
| meta-tags: | | |
| type=raw,value=build-ghbuilder-nodistrib-${{ github.run_id }} | |
| build-local-nodistrib: | |
| uses: ./.github/workflows/build.yml | |
| permissions: | |
| contents: read | |
| id-token: write | |
| with: | |
| distribute: false | |
| artifact-name: build-nodistrib-output | |
| artifact-upload: true | |
| file: test/hello.Dockerfile | |
| output: local | |
| platforms: linux/amd64,linux/arm64 | |
| sbom: true | |
| sign: ${{ github.event_name != 'pull_request' }} | |
| build-auth-scope: | |
| uses: ./.github/workflows/build.yml | |
| permissions: | |
| contents: read | |
| id-token: write | |
| packages: write | |
| with: | |
| build-args: | | |
| VERSION={{meta.version}} | |
| file: test/hello.Dockerfile | |
| output: image | |
| platforms: linux/amd64,linux/arm64 | |
| push: ${{ github.event_name != 'pull_request' }} | |
| sbom: true | |
| meta-images: ghcr.io/docker/github-builder-test | |
| meta-tags: | | |
| type=raw,value=build-scope-${{ github.run_id }} | |
| secrets: | |
| registry-auths: | | |
| - registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| scope: '@push' | |
| build-auth-scope-verify: | |
| uses: ./.github/workflows/verify.yml | |
| if: ${{ github.event_name != 'pull_request' }} | |
| needs: | |
| - build-auth-scope | |
| with: | |
| builder-outputs: ${{ toJSON(needs.build-auth-scope.outputs) }} | |
| secrets: | |
| registry-auths: | | |
| - registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| build-ghcr-index-annotations: | |
| uses: ./.github/workflows/build.yml | |
| permissions: | |
| contents: read | |
| id-token: write | |
| packages: write | |
| with: | |
| annotations: | | |
| io.github.docker.github-builder.test-direct-index-annotation={{meta.version}} | |
| labels: | | |
| io.github.docker.github-builder.test-direct-label=build-{{meta.version}} | |
| build-args: | | |
| VERSION={{meta.version}} | |
| file: test/hello.Dockerfile | |
| output: image | |
| platforms: linux/amd64,linux/arm64 | |
| push: ${{ github.event_name != 'pull_request' }} | |
| sbom: true | |
| set-meta-annotations: true | |
| set-meta-labels: true | |
| meta-images: ghcr.io/docker/github-builder-test | |
| meta-tags: | | |
| type=raw,value=build-index-annotations-${{ github.run_id }} | |
| meta-labels: | | |
| io.github.docker.github-builder.test-meta-label=build-${{ github.run_id }} | |
| meta-annotations: | | |
| io.github.docker.github-builder.test-meta-index-annotation=build-${{ github.run_id }} | |
| secrets: | |
| registry-auths: | | |
| - registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| build-ghcr-image-casing: | |
| strategy: | |
| matrix: | |
| include: | |
| - variant: plain | |
| images: ghcr.io/docker/GitHub-Builder-Test | |
| - variant: attributes | |
| images: | | |
| name=registry.invalid/disabled/app,enable=false | |
| name=ghcr.io/docker/GitHub-Builder-Test,enable=true | |
| uses: ./.github/workflows/build.yml | |
| permissions: | |
| contents: read | |
| id-token: write | |
| packages: write | |
| with: | |
| build-args: | | |
| VERSION={{meta.version}} | |
| file: test/hello.Dockerfile | |
| output: image | |
| platforms: linux/amd64,linux/arm64 | |
| push: ${{ github.event_name != 'pull_request' }} | |
| sbom: true | |
| set-meta-annotations: true | |
| meta-images: ${{ matrix.images }} | |
| meta-tags: | | |
| type=raw,value=build-image-casing-${{ matrix.variant }}-${{ github.run_id }} | |
| secrets: | |
| registry-auths: | | |
| - registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| build-local-login: | |
| uses: ./.github/workflows/build.yml | |
| if: ${{ github.event_name != 'pull_request' }} | |
| permissions: | |
| contents: read | |
| id-token: write | |
| with: | |
| artifact-name: build-login-output | |
| artifact-upload: true | |
| file: test/dhi.Dockerfile | |
| output: local | |
| registry-login: true | |
| sbom: true | |
| sign: true | |
| registry-identities: | | |
| - type: dockerhub | |
| registry: dhi.io | |
| username: ${{ vars.DOCKERHUB_OIDC_USERNAME }} | |
| connection_id: ${{ vars.DOCKERHUB_OIDC_CONNECTIONID }} | |
| scope: 'dhi.io@pull' | |
| build-source-date-epoch: | |
| strategy: | |
| matrix: | |
| epoch: | |
| - '0' | |
| - '1704067200' | |
| - 'commit' | |
| output: | |
| - image | |
| - local | |
| uses: ./.github/workflows/build.yml | |
| permissions: | |
| contents: read | |
| id-token: write | |
| packages: write | |
| with: | |
| output: ${{ matrix.output }} | |
| push: ${{ matrix.output == 'image' && github.event_name != 'pull_request' }} | |
| platforms: linux/amd64 | |
| source-date-epoch: ${{ matrix.epoch }} | |
| set-meta-labels: true | |
| set-meta-annotations: true | |
| meta-images: ghcr.io/docker/github-builder-test | |
| meta-tags: | | |
| type=raw,value=build-epoch-${{ matrix.epoch }}-${{ github.run_id }}-${{ github.run_attempt }} | |
| meta-labels: | | |
| org.opencontainers.image.created=2000-01-01T00:00:00Z | |
| meta-annotations: | | |
| org.opencontainers.image.created=2000-01-01T00:00:00Z | |
| file: test/source-date-epoch.Dockerfile | |
| build-args: | | |
| SOURCE_DATE_EPOCH=1 | |
| EXPECTED_EPOCH=${{ matrix.epoch }} | |
| secrets: | |
| registry-auths: | | |
| - registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| build-source-date-epoch-verify: | |
| if: ${{ github.event_name != 'pull_request' }} | |
| needs: | |
| - build-source-date-epoch | |
| runs-on: ubuntu-26.04 | |
| permissions: | |
| packages: read | |
| strategy: | |
| matrix: | |
| epoch: | |
| - '0' | |
| - '1704067200' | |
| - 'commit' | |
| steps: | |
| - | |
| name: Login to GHCR | |
| uses: docker/login-action@8aa5831fb8d48d8f76594c7ddde61ae58019f550 # v4.8.0 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - | |
| name: Check image file timestamp | |
| uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 | |
| env: | |
| IMAGE: ghcr.io/docker/github-builder-test:build-epoch-${{ matrix.epoch }}-${{ github.run_id }}-${{ github.run_attempt }} | |
| with: | |
| script: | | |
| const assert = require('node:assert/strict'); | |
| const fs = require('node:fs'); | |
| const os = require('node:os'); | |
| const path = require('node:path'); | |
| const image = process.env.IMAGE; | |
| await exec.exec('docker', ['pull', '--platform', 'linux/amd64', image]); | |
| const {stdout} = await exec.getExecOutput('docker', ['create', '--platform', 'linux/amd64', image, '/unused']); | |
| const container = stdout.trim(); | |
| const directory = fs.mkdtempSync(path.join(os.tmpdir(), 'source-date-epoch-')); | |
| try { | |
| const file = path.join(directory, 'epoch'); | |
| await exec.exec('docker', ['cp', `${container}:/epoch`, file]); | |
| const epoch = Number(fs.readFileSync(file, 'utf8').trim()); | |
| const mtime = fs.statSync(file).mtimeMs / 1000; | |
| assert.equal(mtime, epoch, `Expected image file timestamp ${epoch}, got ${mtime}`); | |
| core.info(`Image file timestamp matches SOURCE_DATE_EPOCH=${epoch}`); | |
| } finally { | |
| await exec.exec('docker', ['rm', container]); | |
| fs.rmSync(directory, {recursive: true, force: true}); | |
| } |