diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index a33a0a8..0697bb5 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -25,21 +25,30 @@ on: jobs: build: runs-on: ubuntu-latest + timeout-minutes: 20 + strategy: + fail-fast: false + matrix: + platform: + - linux/amd64 + - linux/arm64 + - linux/ppc64le steps: - uses: actions/checkout@v3 - - uses: docker/metadata-action@v4 - id: metadata - with: - images: ghcr.io/${{ github.repository }} - - uses: int128/docker-build-cache-config-action@v1 - id: cache - with: - image: ghcr.io/${{ github.repository }}/cache - uses: docker/login-action@v2 with: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - uses: docker/metadata-action@v4 + id: metadata + with: + images: ghcr.io/${{ github.repository }} + flavor: suffix=-${{ matrix.platform }} + - uses: int128/docker-build-cache-config-action@v1 + id: cache + with: + image: ghcr.io/${{ github.repository }}/cache - uses: docker/setup-qemu-action@v2 - uses: docker/setup-buildx-action@v2 - uses: docker/build-push-action@v3 @@ -49,4 +58,27 @@ jobs: labels: ${{ steps.metadata.outputs.labels }} cache-from: ${{ steps.cache.outputs.cache-from }} cache-to: ${{ steps.cache.outputs.cache-to }} - platforms: linux/amd64,linux/arm64,linux/ppc64le + platforms: ${{ matrix.platform }} + + build-multi-architecture: + needs: + - build + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - uses: docker/metadata-action@v4 + id: metadata + with: + images: ghcr.io/${{ github.repository }} + - uses: int128/docker-manifest-create-action@v1 + with: + tags: ${{ steps.metadata.outputs.tags }} + suffixes: | + -linux-amd64 + -linux-arm64 + -linux-ppc64le