|
8 | 8 | IMAGE_NAME: ${{ github.repository }}
|
9 | 9 |
|
10 | 10 | jobs:
|
11 |
| - container: |
12 |
| - runs-on: ubuntu-20.04 |
| 11 | + build: |
| 12 | + runs-on: ${{ matrix.runner }} |
| 13 | + strategy: |
| 14 | + matrix: |
| 15 | + include: |
| 16 | + - arch: amd64 |
| 17 | + runner: ubuntu-20.04 |
| 18 | + - arch: arm64 |
| 19 | + runner: arm-4core-linux-ubuntu24.04 |
13 | 20 | permissions:
|
14 | 21 | contents: read
|
15 | 22 | packages: write
|
@@ -46,10 +53,42 @@ jobs:
|
46 | 53 | uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # v6.9.0
|
47 | 54 | with:
|
48 | 55 | file: Dockerfile
|
49 |
| - builder: ${{ steps.buildx.outputs.name }} |
| 56 | + tags: ${{ steps.meta.outputs.tags }}-${{ matrix.arch }} |
50 | 57 | push: true
|
51 |
| - platforms: linux/amd64, linux/arm64 |
52 |
| - tags: ${{ steps.meta.outputs.tags }} |
53 | 58 | labels: ${{ steps.meta.outputs.labels }}
|
54 |
| - cache-from: type=gha, scope=${{ github.workflow }} |
55 |
| - cache-to: type=gha, scope=${{ github.workflow }} |
| 59 | + cache-from: type=registry,ref=ghcr.io/datadog/lading:cache |
| 60 | + cache-to: type=registry,ref=ghcr.io/datadog/lading:cache,mode=max |
| 61 | + |
| 62 | + manifest: |
| 63 | + name: Create Multi-Arch Manifest |
| 64 | + needs: build |
| 65 | + runs-on: ubuntu-20.04 |
| 66 | + permissions: |
| 67 | + contents: read |
| 68 | + packages: write |
| 69 | + |
| 70 | + steps: |
| 71 | + - name: Log in to Container Registry |
| 72 | + uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0 |
| 73 | + with: |
| 74 | + registry: ${{ env.REGISTRY }} |
| 75 | + username: ${{ github.actor }} |
| 76 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 77 | + |
| 78 | + - name: Set up Docker Buildx |
| 79 | + uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # v3.7.1 |
| 80 | + |
| 81 | + - name: Extract Docker Metadata |
| 82 | + uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5.5.1 |
| 83 | + id: meta |
| 84 | + with: |
| 85 | + tags: | |
| 86 | + type=sha,format=long |
| 87 | + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} |
| 88 | + |
| 89 | + - name: Create and Push Multiarch Manifest |
| 90 | + run: | |
| 91 | + docker buildx imagetools create \ |
| 92 | + --tag ${{ steps.meta.outputs.tags }} \ |
| 93 | + ${{ steps.meta.outputs.tags }}-amd64 \ |
| 94 | + ${{ steps.meta.outputs.tags }}-arm64 |
0 commit comments