Skip to content

Commit e0b2704

Browse files
committed
ci: distribute multi-platform bin-image build
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
1 parent e23695d commit e0b2704

File tree

1 file changed

+14
-45
lines changed

1 file changed

+14
-45
lines changed

.github/workflows/build.yml

Lines changed: 14 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -405,54 +405,23 @@ jobs:
405405
if-no-files-found: error
406406

407407
bin-image:
408-
runs-on: ubuntu-24.04
408+
uses: crazy-max/docker-bake-action/.github/workflows/reusable-distribute-mp.yml@distribute-workflow
409409
needs:
410410
- test-integration
411411
- test-unit
412-
if: ${{ github.event_name != 'pull_request' && github.repository == 'docker/buildx' }}
413-
steps:
414-
-
415-
name: Set up QEMU
416-
uses: docker/setup-qemu-action@v3
417-
-
418-
name: Set up Docker Buildx
419-
uses: docker/setup-buildx-action@v3
420-
with:
421-
version: ${{ env.SETUP_BUILDX_VERSION }}
422-
driver-opts: image=${{ env.SETUP_BUILDKIT_IMAGE }}
423-
buildkitd-flags: --debug
424-
-
425-
name: Docker meta
426-
id: meta
427-
uses: docker/metadata-action@v5
428-
with:
429-
images: |
430-
${{ env.REPO_SLUG }}
431-
tags: |
432-
type=ref,event=branch
433-
type=ref,event=pr
434-
type=semver,pattern={{version}}
435-
bake-target: meta-helper
436-
-
437-
name: Login to DockerHub
438-
if: github.event_name != 'pull_request'
439-
uses: docker/login-action@v3
440-
with:
441-
username: ${{ vars.DOCKERPUBLICBOT_USERNAME }}
442-
password: ${{ secrets.DOCKERPUBLICBOT_WRITE_PAT }}
443-
-
444-
name: Build and push image
445-
uses: docker/bake-action@v6
446-
with:
447-
files: |
448-
./docker-bake.hcl
449-
cwd://${{ steps.meta.outputs.bake-file }}
450-
targets: image-cross
451-
push: ${{ github.event_name != 'pull_request' }}
452-
sbom: true
453-
set: |
454-
*.cache-from=type=gha,scope=bin-image
455-
*.cache-to=type=gha,scope=bin-image,mode=max
412+
with:
413+
target: image-cross
414+
push: ${{ github.event_name != 'pull_request' && github.repository == 'docker/buildx' }}
415+
cache: true
416+
meta-image: docker/buildx-bin
417+
meta-tags: |
418+
type=ref,event=branch
419+
type=ref,event=pr
420+
type=semver,pattern={{version}}
421+
meta-bake-target: meta-helper
422+
login-username: ${{ vars.DOCKERPUBLICBOT_USERNAME }}
423+
secrets:
424+
login-password: ${{ secrets.DOCKERPUBLICBOT_WRITE_PAT }}
456425

457426
scout:
458427
runs-on: ubuntu-24.04

0 commit comments

Comments
 (0)