From e07d02f39dfafd67edb9988810dce0d5bf30f89e Mon Sep 17 00:00:00 2001 From: diced Date: Fri, 31 Jan 2025 15:21:12 -0800 Subject: [PATCH] feat: try matrix docker action --- .github/workflows/docker.yml | 48 +++++++++--------------------------- 1 file changed, 12 insertions(+), 36 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index abc702a0..c5d97799 100755 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -6,9 +6,14 @@ on: workflow_dispatch: jobs: - push-amd64: - name: 'push (amd64)' - runs-on: ubuntu-24.04 + push: + strategy: + matrix: + os: [ubuntu-24.04, ubuntu-24.04-arm] + arch: [amd64, arm64] + + name: push + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 @@ -27,46 +32,17 @@ jobs: - uses: docker/build-push-action@v6 with: push: true - platforms: linux/amd64 + platforms: linux/${{ matrix.arch }} cache-from: type=gha cache-to: type=gha,mode=max provenance: false tags: | - ghcr.io/diced/zipline:v4-amd64 - ghcr.io/diced/zipline:v4-${{ steps.sha.outputs.short_sha }}-amd64 - - push-arm64: - name: 'push (arm64)' - runs-on: ubuntu-24.04-arm - steps: - - uses: actions/checkout@v4 - - - name: Get commit sha - id: sha - run: | - echo "short_sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT - - - uses: docker/setup-buildx-action@v3 - - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - uses: docker/build-push-action@v6 - with: - push: true - platforms: linux/arm64 - cache-from: type=gha - cache-to: type=gha,mode=max - provenance: false - tags: | - ghcr.io/diced/zipline:v4-arm64 - ghcr.io/diced/zipline:v4-${{ steps.sha.outputs.short_sha }}-arm64 + ghcr.io/diced/zipline:v4-${{ matrix.arch }} + ghcr.io/diced/zipline:v4-${{ steps.sha.outputs.short_sha }}-${{ matrix.arch }} ammend-builds: runs-on: ubuntu-24.04 - needs: [push-amd64, push-arm64] + needs: push steps: - uses: actions/checkout@v4 - name: Get commit sha