Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parallel build of multi-architectures image #1021

Merged
merged 2 commits into from
Dec 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 49 additions & 5 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,54 @@ on:
- v*

jobs:
build:
build-linux-amd64:
uses: int128/docker-build-workflow/.github/workflows/build.yaml@v1
with:
platforms: linux/amd64
flavor: latest=false,suffix=-linux-amd64

build-linux-arm64:
uses: int128/docker-build-workflow/.github/workflows/build.yaml@v1
with:
platforms: linux/arm64
flavor: latest=false,suffix=-linux-arm64

build-linux-ppc64le:
uses: int128/docker-build-workflow/.github/workflows/build.yaml@v1
with:
platforms: |
linux/amd64
linux/arm64
linux/ppc64le
platforms: linux/ppc64le
flavor: latest=false,suffix=-linux-ppc64le

build:
needs:
- build-linux-amd64
- build-linux-arm64
- build-linux-ppc64le
runs-on: ubuntu-latest
timeout-minutes: 10
outputs:
image-uri: ghcr.io/${{ github.repository }}@${{ steps.build.outputs.digest }}
steps:
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/metadata-action@v5
id: metadata
with:
images: ghcr.io/${{ github.repository }}
- uses: int128/docker-manifest-create-action@v2
id: build
with:
tags: ${{ steps.metadata.outputs.tags }}
sources: |
ghcr.io/${{ github.repository }}@${{ needs.build-linux-amd64.outputs.digest }}
ghcr.io/${{ github.repository }}@${{ needs.build-linux-arm64.outputs.digest }}
ghcr.io/${{ github.repository }}@${{ needs.build-linux-ppc64le.outputs.digest }}

test:
needs: build
runs-on: ubuntu-latest
steps:
- run: docker run --rm '${{ needs.build.outputs.image-uri }}' --help