Skip to content

Commit 80278e2

Browse files
committed
chore: use platforms to build arm + amd
1 parent 59b0505 commit 80278e2

1 file changed

Lines changed: 6 additions & 47 deletions

File tree

.github/workflows/build.yaml

Lines changed: 6 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,10 @@ jobs:
1414
contents: read
1515
strategy:
1616
matrix:
17-
# we'll build both ARM & x86 images
1817
include:
19-
- os: ubuntu-latest
20-
platform: linux/amd64
21-
suffix: amd64
22-
- os: arm-64
23-
platform: linux/arm64
24-
suffix: arm64
18+
- pg_version: '17'
2519

26-
runs-on: ${{ matrix.os }}
20+
runs-on: ubuntu-latest
2721

2822
steps:
2923
- name: Checkout
@@ -45,43 +39,8 @@ jobs:
4539
build-args: GH_TOKEN=${{ secrets.GITHUB_TOKEN }}
4640
context: .
4741
cache-from: type=gha
48-
cache-to: type=gha,mode=max`
42+
cache-to: type=gha,mode=max
43+
platforms: linux/amd64,linux/arm64
4944
push: true
50-
tags: ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}:${{ github.sha }}-${{ matrix.suffix }}
51-
file: Dockerfile
52-
# this job will create a multi-architecture manifest
53-
# so the same image tag can be used to pull the image
54-
# on any architecture
55-
finalize:
56-
name: Create Multi-Architecture Manifest
57-
runs-on: ubuntu-latest
58-
needs: build
59-
permissions:
60-
packages: write
61-
contents: read
62-
env:
63-
PG_TAG: '17'
64-
steps:
65-
- name: Set up Docker Buildx
66-
uses: docker/setup-buildx-action@v2
67-
68-
- name: 'Login to GitHub Container Registry'
69-
uses: docker/login-action@v1
70-
with:
71-
registry: ghcr.io
72-
username: ${{ github.repository_owner }}
73-
password: ${{secrets.GITHUB_TOKEN}}
74-
75-
- name: Create and Push Multi-Architecture Manifest
76-
run: |
77-
docker buildx imagetools create \
78-
--tag ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}:${{ github.sha }} \
79-
ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}:${{ github.sha }}-amd64 \
80-
ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}:${{ github.sha }}-arm64
81-
82-
- name: Create and Push Multi-Architecture Manifest for PG_TAG
83-
run: |
84-
docker buildx imagetools create \
85-
--tag ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}:$PG_TAG \
86-
ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}:${{ github.sha }}-amd64 \
87-
ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}:${{ github.sha }}-arm64
45+
tags: ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}:${{ github.sha }},ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}:${{ matrix.pg_version }}
46+
file: Dockerfile

0 commit comments

Comments
 (0)