Skip to content

Commit b154e92

Browse files
committed
Fix
1 parent 44f236e commit b154e92

File tree

1 file changed

+40
-18
lines changed

1 file changed

+40
-18
lines changed

.github/workflows/sdk-ci.yml

Lines changed: 40 additions & 18 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,60 @@ 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
29+
30+
- name: Login to DockerHub
31+
uses: docker/login-action@v3
32+
with:
33+
username: ${{ github.actor }}
34+
password: ${{ secrets.DOCKER_HUB_TOKEN }}
35+
36+
- name: Build Docker image (multi-arch, no push)
2737
uses: docker/build-push-action@v6
38+
id: build
2839
with:
2940
context: .
30-
load: true
41+
platforms: linux/amd64
42+
push: false
43+
load: true # Allows testing the image locally
3144
tags: ${{ env.TEST_TAG }}
32-
- name: Test SDK
45+
46+
- name: Run Tests (from built image)
3347
run: bash ./test_sdk.sh ${{ env.TEST_TAG }}
34-
- name: Log into Docker Hub
48+
49+
push-image:
50+
needs: build-and-test
51+
runs-on: ubuntu-latest
52+
steps:
53+
- name: Checkout code
54+
uses: actions/checkout@v3
55+
56+
- name: Set up QEMU
57+
uses: docker/setup-qemu-action@v3
58+
59+
- name: Set up Docker Buildx
60+
uses: docker/setup-buildx-action@v3
61+
62+
- name: Login to DockerHub
3563
uses: docker/login-action@v3
3664
with:
3765
username: ${{ github.actor }}
3866
password: ${{ secrets.DOCKER_HUB_TOKEN }}
39-
- name: Extract SDK metadata
40-
id: meta
41-
uses: docker/metadata-action@v4
42-
with:
43-
images: lukstep/raspberry-pi-pico-sdk
44-
- name: Push SDK image
45-
if: github.event_name == 'release' && github.event.action == 'published'
67+
68+
- name: Build and Push Docker image (multi-arch)
4669
uses: docker/build-push-action@v6
4770
with:
4871
context: .
49-
push: true
50-
tags: ${{ steps.meta.outputs.tags }}
51-
labels: ${{ steps.meta.outputs.labels }}
5272
platforms: linux/amd64,linux/arm64
73+
push: true
74+
tags: lukstep/raspberry-pi-pico-sdk:latest

0 commit comments

Comments
 (0)