Skip to content

Commit 7624ac2

Browse files
committed
ci: add multi-architecture build testing with caching
1 parent d7287e9 commit 7624ac2

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

.github/workflows/cd.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,33 @@ env:
1313
IMAGE_NAME: network-tools
1414

1515
jobs:
16+
# Test building on multiple architectures
17+
test:
18+
runs-on: ubuntu-latest
19+
strategy:
20+
matrix:
21+
platform: [linux/amd64, linux/arm64]
22+
steps:
23+
- name: Check out repository
24+
uses: actions/checkout@main
25+
26+
- name: Set up QEMU
27+
uses: docker/setup-qemu-action@master
28+
29+
- name: Set up Docker Buildx
30+
uses: docker/setup-buildx-action@master
31+
32+
- name: Test build for ${{ matrix.platform }}
33+
uses: docker/build-push-action@master
34+
with:
35+
context: .
36+
platforms: ${{ matrix.platform }}
37+
push: false
38+
cache-from: type=gha
39+
cache-to: type=gha,mode=max
40+
1641
publish:
42+
needs: test
1743
runs-on: ubuntu-latest
1844
if: ${{ github.event_name != 'pull_request' }}
1945

0 commit comments

Comments
 (0)