Skip to content

Commit 5f6a6d1

Browse files
committed
Fix
1 parent 44f236e commit 5f6a6d1

File tree

1 file changed

+47
-24
lines changed

1 file changed

+47
-24
lines changed

.github/workflows/sdk-ci.yml

Lines changed: 47 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
name: Raspberry PI Pico Docker SDK CI
1+
2+
name: Build, test and push Docker image
23

34
on:
45
push:
@@ -14,39 +15,61 @@ env:
1415
TEST_TAG: pico_test_sdk
1516

1617
jobs:
17-
sdk_container:
18+
build-and-test:
1819
runs-on: ubuntu-latest
1920
steps:
20-
- name: Checkout
21+
- name: Checkout code
2122
uses: actions/checkout@v3
22-
- name: Set up QEMU
23+
24+
- name: Set up QEMU (for ARM builds)
2325
uses: docker/setup-qemu-action@v3
26+
2427
- name: Set up Docker Buildx
2528
uses: docker/setup-buildx-action@v3
26-
- name: Build SDK
27-
uses: docker/build-push-action@v6
28-
with:
29-
context: .
30-
load: true
31-
tags: ${{ env.TEST_TAG }}
32-
- name: Test SDK
33-
run: bash ./test_sdk.sh ${{ env.TEST_TAG }}
34-
- name: Log into Docker Hub
29+
30+
- name: Login to DockerHub
3531
uses: docker/login-action@v3
3632
with:
3733
username: ${{ github.actor }}
38-
password: ${{ secrets.DOCKER_HUB_TOKEN }}
39-
- name: Extract SDK metadata
40-
id: meta
41-
uses: docker/metadata-action@v4
34+
password: ${{ secrets.DOCKERHUB_TOKEN }}
35+
36+
- name: Build Docker image (multi-arch, no push)
37+
uses: docker/build-push-action@v5
38+
id: build
4239
with:
43-
images: lukstep/raspberry-pi-pico-sdk
44-
- name: Push SDK image
45-
if: github.event_name == 'release' && github.event.action == 'published'
46-
uses: docker/build-push-action@v6
40+
context: .
41+
platforms: linux/amd64,linux/arm64
42+
push: false
43+
load: true # Allows testing the image locally
44+
tags: test-image:latest
45+
46+
- name: Run Tests (from built image)
47+
run:
48+
run: bash ./test_sdk.sh ${{ env.TEST_TAG }}
49+
50+
push-image:
51+
needs: build-and-test
52+
runs-on: ubuntu-latest
53+
steps:
54+
- name: Checkout code
55+
uses: actions/checkout@v3
56+
57+
- name: Set up QEMU
58+
uses: docker/setup-qemu-action@v3
59+
60+
- name: Set up Docker Buildx
61+
uses: docker/setup-buildx-action@v3
62+
63+
- name: Login to DockerHub
64+
uses: docker/login-action@v3
65+
with:
66+
username: ${{ secrets.DOCKERHUB_USERNAME }}
67+
password: ${{ secrets.DOCKERHUB_TOKEN }}
68+
69+
- name: Build and Push Docker image (multi-arch)
70+
uses: docker/build-push-action@v5
4771
with:
4872
context: .
49-
push: true
50-
tags: ${{ steps.meta.outputs.tags }}
51-
labels: ${{ steps.meta.outputs.labels }}
5273
platforms: linux/amd64,linux/arm64
74+
push: true
75+
tags: lukstep/raspberry-pi-pico-sdk:latest

0 commit comments

Comments
 (0)