Skip to content

Commit dee93fe

Browse files
authored
Add linux/arm64 platform using matrix (#231)
Also: Set key for ccache from matrix https://github.com/hendrikmuhs/ccache-action?tab=readme-ov-file#if-you-have-multiple-jobs
1 parent 666c29b commit dee93fe

2 files changed

Lines changed: 39 additions & 3 deletions

File tree

.github/workflows/dockerimage.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,30 @@ env:
1212

1313
jobs:
1414
build:
15-
runs-on: ubuntu-latest
15+
strategy:
16+
matrix:
17+
os:
18+
- ubuntu-24.04
19+
- ubuntu-24.04-arm
20+
platform:
21+
- amd64
22+
- arm64
23+
exclude:
24+
- os: ubuntu-24.04
25+
platform: arm64
26+
- os: ubuntu-24.04-arm
27+
platform: amd64
28+
29+
runs-on: ${{ matrix.os }}
1630

1731
steps:
1832
- name: Checkout
1933
uses: actions/checkout@v4
2034

2135
- name: ccache
2236
uses: hendrikmuhs/ccache-action@v1.2
37+
with:
38+
key: ${{ matrix.os }}-${{ matrix.platform }}
2339

2440
- name: Get latest node version
2541
run: echo "LATEST_VERSION=$(curl -fsSLo- --compressed https://nodejs.org/dist/index.json | jq '.[].version' | tr -d '"' | tr -d 'v' | head -1)" >> $GITHUB_ENV
@@ -42,6 +58,7 @@ jobs:
4258
uses: docker/build-push-action@v6
4359
with:
4460
context: .
61+
platforms: linux/${{ matrix.platform }}
4562
load: true
4663
tags: ${{ env.IMAGE_NAME }}-${{ env.LATEST_VERSION }}
4764

.github/workflows/update-current-image.yml

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,35 @@ jobs:
2424
run: echo ${{ steps.get_version.outputs.NODE_VERSION }}
2525

2626
build_push:
27+
strategy:
28+
matrix:
29+
os:
30+
- ubuntu-24.04
31+
- ubuntu-24.04-arm
32+
platform:
33+
- amd64
34+
- arm64
35+
exclude:
36+
- os: ubuntu-24.04
37+
platform: arm64
38+
- os: ubuntu-24.04-arm
39+
platform: amd64
40+
2741
needs: check_version
28-
runs-on: ubuntu-latest
42+
runs-on: ${{ matrix.os }}
43+
2944
if: needs.check_version.outputs.NODE_VERSION
3045
env:
3146
NODE_VERSION: ${{needs.check_version.outputs.NODE_VERSION}}
47+
3248
steps:
3349
- name: Checkout
3450
uses: actions/checkout@v4
3551

3652
- name: ccache
3753
uses: hendrikmuhs/ccache-action@v1.2
54+
with:
55+
key: ${{ matrix.os }}-${{ matrix.platform }}
3856

3957
- name: Show NODE_VERSION
4058
run: echo $NODE_VERION
@@ -65,6 +83,7 @@ jobs:
6583
DOCKER_BUILD_SUMMARY: false
6684
with:
6785
context: .
86+
platforms: linux/${{ matrix.platform }}
6887
load: true
6988
tags: ${{ env.IMAGE_NAME }}-${{ needs.check_version.outputs.NODE_VERSION }}
7089

@@ -99,7 +118,7 @@ jobs:
99118
uses: docker/build-push-action@v6
100119
with:
101120
context: .
102-
platforms: linux/amd64
121+
platforms: linux/${{ matrix.platform }}
103122
push: true
104123
provenance: mode=max
105124
sbom: true

0 commit comments

Comments
 (0)