Skip to content

Commit a045cbf

Browse files
committed
ci: distribute multi-platform bin-image build
Signed-off-by: CrazyMax <[email protected]>
1 parent e3c6618 commit a045cbf

File tree

1 file changed

+20
-60
lines changed

1 file changed

+20
-60
lines changed

.github/workflows/build.yml

Lines changed: 20 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ env:
3131
SETUP_BUILDX_VERSION: "edge"
3232
SETUP_BUILDKIT_IMAGE: "moby/buildkit:latest"
3333
SCOUT_VERSION: "1.11.0"
34-
REPO_SLUG: "docker/buildx-bin"
3534
DESTDIR: "./bin"
3635
TEST_CACHE_SCOPE: "test"
3736
TESTFLAGS: "-v --parallel=6 --timeout=30m"
@@ -408,67 +407,28 @@ jobs:
408407
if-no-files-found: error
409408

410409
bin-image:
411-
runs-on: ubuntu-24.04
410+
uses: crazy-max/.github/.github/workflows/bake-distribute-mp.yml@5e6d2af9d3297386cde72c8f7350b2d7e23d759c
412411
needs:
413412
- test-integration
414413
- 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@v4
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:
456-
username: ${{ vars.DOCKERPUBLICBOT_USERNAME }}
457-
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
414+
with:
415+
target: image-cross
416+
push: ${{ github.event_name != 'pull_request' && github.repository == 'docker/buildx' }}
417+
cache: true
418+
cache-scope: bin-image
419+
meta-image: docker/buildx-bin
420+
meta-tags: |
421+
type=ref,event=branch
422+
type=ref,event=pr
423+
type=semver,pattern={{version}}
424+
meta-bake-target: meta-helper
425+
login-username: ${{ vars.DOCKERPUBLICBOT_USERNAME }}
426+
buildx-version: ${{ env.SETUP_BUILDX_VERSION }}
427+
buildx-driver-opts: image=${{ env.SETUP_BUILDKIT_IMAGE }}
428+
buildkitd-flags: --debug
429+
bake-source: .
430+
secrets:
431+
login-password: ${{ secrets.DOCKERPUBLICBOT_WRITE_PAT }}
472432

473433
scout:
474434
runs-on: ubuntu-24.04
@@ -494,7 +454,7 @@ jobs:
494454
with:
495455
version: ${{ env.SCOUT_VERSION }}
496456
format: sarif
497-
image: registry://${{ env.REPO_SLUG }}:master
457+
image: registry://docker/buildx-bin:master
498458
-
499459
name: Upload SARIF report
500460
uses: github/codeql-action/upload-sarif@v3

0 commit comments

Comments
 (0)