Skip to content

Commit 3aaccb8

Browse files
committed
ci: use docker github builder to build bin image
Signed-off-by: CrazyMax <[email protected]>
1 parent a2cf0ed commit 3aaccb8

File tree

1 file changed

+22
-56
lines changed

1 file changed

+22
-56
lines changed

.github/workflows/build.yml

Lines changed: 22 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -408,67 +408,33 @@ jobs:
408408
if-no-files-found: error
409409

410410
bin-image:
411-
runs-on: ubuntu-24.04
411+
if: ${{ github.event_name != 'pull_request' && github.repository == 'docker/buildx' }}
412+
uses: docker/github-builder-experimental/.github/workflows/bake.yml@bake
412413
needs:
413414
- test-integration
414415
- test-unit
415-
if: ${{ github.event_name != 'pull_request' && github.repository == 'docker/buildx' }}
416-
steps:
417-
-
418-
name: Free disk space
419-
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1
420-
with:
421-
android: true
422-
dotnet: true
423-
haskell: true
424-
large-packages: true
425-
swap-storage: true
426-
-
427-
name: Checkout
428-
uses: actions/checkout@v5
429-
-
430-
name: Set up QEMU
431-
uses: docker/setup-qemu-action@v3
432-
-
433-
name: Set up Docker Buildx
434-
uses: docker/setup-buildx-action@v3
435-
with:
436-
version: ${{ env.SETUP_BUILDX_VERSION }}
437-
driver-opts: image=${{ env.SETUP_BUILDKIT_IMAGE }}
438-
buildkitd-flags: --debug
439-
-
440-
name: Docker meta
441-
id: meta
442-
uses: docker/metadata-action@v5
443-
with:
444-
images: |
445-
${{ env.REPO_SLUG }}
446-
tags: |
447-
type=ref,event=branch
448-
type=ref,event=pr
449-
type=semver,pattern={{version}}
450-
bake-target: meta-helper
451-
-
452-
name: Login to DockerHub
453-
if: github.event_name != 'pull_request'
454-
uses: docker/login-action@v3
455-
with:
416+
permissions:
417+
contents: read
418+
id-token: write # for signing attestation manifests with GitHub OIDC Token
419+
packages: write # needed to push images to GitHub Container Registry
420+
with:
421+
target: image-cross
422+
output: ${{ github.event_name != 'pull_request' && 'registry' || 'cacheonly' }}
423+
cache: true
424+
cache-scope: bin-image
425+
meta-images: |
426+
${{ env.REPO_SLUG }}
427+
meta-tags: |
428+
type=ref,event=branch
429+
type=ref,event=pr
430+
type=semver,pattern={{version}}
431+
meta-bake-target: meta-helper
432+
bake-sbom: true
433+
secrets:
434+
registry-auths: |
435+
- registry: docker.io
456436
username: ${{ vars.DOCKERPUBLICBOT_USERNAME }}
457437
password: ${{ secrets.DOCKERPUBLICBOT_WRITE_PAT }}
458-
-
459-
name: Build and push image
460-
uses: docker/bake-action@v6
461-
with:
462-
source: .
463-
files: |
464-
./docker-bake.hcl
465-
${{ steps.meta.outputs.bake-file }}
466-
targets: image-cross
467-
push: ${{ github.event_name != 'pull_request' }}
468-
sbom: true
469-
set: |
470-
*.cache-from=type=gha,scope=bin-image
471-
*.cache-to=type=gha,scope=bin-image,mode=max
472438
473439
scout:
474440
runs-on: ubuntu-24.04

0 commit comments

Comments
 (0)