Skip to content

Commit

Permalink
Use a matrix build for building the docker image
Browse files Browse the repository at this point in the history
Using parallel jobs means each worker can 100% dedicate itself to
building for the relevant platform, rather than splitting its
resources cross-compiling.
  • Loading branch information
antifuchs committed Aug 16, 2023
1 parent 033ae4e commit b5f8b88
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ jobs:
docker_build:
#if: github.event_name != 'pull_request'
runs-on: ubuntu-latest
strategy:
matrix:
platform:
- linux/amd64
- linux/arm64
permissions:
contents: read
packages: write
Expand Down Expand Up @@ -58,12 +63,12 @@ jobs:

# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
- name: Build and push Docker image
- name: Build and push Docker image for ${{matrix.platform}}
id: build-and-push
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64,linux/arm64
platforms: ${{ matrix.platform }}
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
Expand Down

0 comments on commit b5f8b88

Please sign in to comment.