Skip to content

Commit 8248f1f

Browse files
committed
chore: build arm64 docker in gha
1 parent f4a1906 commit 8248f1f

File tree

1 file changed

+33
-1
lines changed

1 file changed

+33
-1
lines changed

.github/workflows/ami-release.yml

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@ on:
1111

1212
jobs:
1313
build:
14-
runs-on: [self-hosted, X64]
14+
strategy:
15+
matrix:
16+
include:
17+
- runner: arm-runner
18+
arch: arm64
19+
runs-on: ${{ matrix.runner }}
1520
timeout-minutes: 150
1621
permissions:
1722
contents: write
@@ -22,6 +27,33 @@ jobs:
2227
- name: Checkout Repo
2328
uses: actions/checkout@v2
2429

30+
- id: args
31+
uses: mikefarah/yq@master
32+
with:
33+
cmd: yq 'to_entries | map(select(.value|type == "!!str")) | map(.key + "=" + .value) | join("\n")' 'ansible/vars.yml'
34+
- run: docker context create builders
35+
- uses: docker/setup-buildx-action@v2
36+
with:
37+
endpoint: builders
38+
- uses: docker/build-push-action@v3
39+
with:
40+
push: false
41+
load: true
42+
build-args: |
43+
${{ steps.args.outputs.result }}
44+
target: extensions
45+
tags: supabase/postgres:extensions
46+
platforms: linux/${{ matrix.arch }}
47+
cache-from: type=gha
48+
cache-to: type=gha,mode=max
49+
- name: Extract built packages
50+
run: |
51+
mkdir -p ansible/extensions/packages
52+
docker save supabase/postgres:extensions | tar xv -C ansible/extensions
53+
for layer in ansible/extensions/*/layer.tar; do
54+
tar xvf "$layer" -C ansible/extensions/packages --strip-components 1
55+
done
56+
2557
- name: Build AMI
2658
run: |
2759
GIT_SHA=${{github.sha}}

0 commit comments

Comments
 (0)