Skip to content

Commit

Permalink
ci: use matrix build for multi-arch build (#156)
Browse files Browse the repository at this point in the history
  • Loading branch information
jpbernius authored Oct 10, 2024
1 parent ad3cccd commit 9bf10d0
Showing 1 changed file with 18 additions and 28 deletions.
46 changes: 18 additions & 28 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,17 @@ on:
workflow_dispatch:

jobs:
build-and-push-hawkeye-amd64:
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- uses: actions/checkout@v4
- name: Build and push by digest
uses: ./.github/actions/docker-push-by-digest
id: build
with:
name: hawkeye
file: Dockerfile
outputs:
digest: ${{ steps.build.outputs.digest }}

build-and-push-hawkeye-arm64:
runs-on: buildjet-4vcpu-ubuntu-2204-arm
build-and-push-hawkeye:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, buildjet-4vcpu-ubuntu-2204-arm]
arch: [amd64, arm64]
include:
- os: ubuntu-latest
arch: amd64
- os: buildjet-4vcpu-ubuntu-2204-arm
arch: arm64
permissions:
packages: write
steps:
Expand All @@ -52,38 +46,34 @@ jobs:
name: hawkeye
file: Dockerfile
outputs:
digest: ${{ steps.build.outputs.digest }}
digest-${{ matrix.arch }}: ${{ steps.build.outputs.digest }}

release-hawkeye:
runs-on: ubuntu-latest
permissions:
packages: write
needs:
- build-and-push-hawkeye-amd64
- build-and-push-hawkeye-arm64
needs: build-and-push-hawkeye
steps:
- uses: actions/checkout@v4
- name: Merge and push manifest
uses: ./.github/actions/docker-release
with:
name: hawkeye
digests: >
${{needs.build-and-push-hawkeye-amd64.outputs.digest}}
${{needs.build-and-push-hawkeye-arm64.outputs.digest}}
${{ needs.build-and-push-hawkeye.outputs.digest-amd64 }}
${{ needs.build-and-push-hawkeye.outputs.digest-arm64 }}
release-native:
runs-on: ubuntu-latest
permissions:
packages: write
needs:
- build-and-push-hawkeye-amd64
- build-and-push-hawkeye-arm64
needs: build-and-push-hawkeye
steps:
- uses: actions/checkout@v4
- name: Merge and push manifest
uses: ./.github/actions/docker-release
with:
name: hawkeye-native
digests: >
ghcr.io/${{ github.repository_owner }}/hawkeye@${{needs.build-and-push-hawkeye-amd64.outputs.digest}}
ghcr.io/${{ github.repository_owner }}/hawkeye@${{needs.build-and-push-hawkeye-arm64.outputs.digest}}
ghcr.io/${{ github.repository_owner }}/hawkeye@${{ needs.build-and-push-hawkeye.outputs.digest-amd64 }}
ghcr.io/${{ github.repository_owner }}/hawkeye@${{ needs.build-and-push-hawkeye.outputs.digest-arm64 }}

0 comments on commit 9bf10d0

Please sign in to comment.