@@ -12,12 +12,8 @@ concurrency:
1212
1313jobs :
1414 build-x86_64 :
15- name : ' Check, Build, Test, Publish DevContainer (x86_64)'
15+ name : ' DevContainer (x86_64)'
1616 runs-on : ubuntu-24.04
17- permissions :
18- contents : read
19- packages : write
20- id-token : write
2117
2218 steps :
2319 - name : Checkout (GitHub)
3127 password : ${{ secrets.GITHUB_TOKEN }}
3228
3329 # Use .devcontainer from THIS repo for building and testing
34- - name : Check, Build, Test, Publish
30+ - name : Check, Build, Test
3531 uses : devcontainers/ci@v0.3
3632 with :
3733 # The .devcontainer is never published as pre-built container.
5248 # Test
5349 ./scripts/test.sh
5450
55- # Optionally: Publish
56- # We do not use the push feature of devcontainers/ci here, since that would push the wrong container.
57- # Instead, we use the publish script which pushes the correct container (residing in src/s-core-devcontainer).
58- if [ "${{ github.ref }}" = "refs/heads/main" ]; then
59- # manually login to ghcr.io for publishing
60- echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
61- ./scripts/publish.sh "main"
62- fi
63-
6451 build-arm64 :
65- name : ' Check, Build, Test, Publish DevContainer (arm64)'
52+ name : ' DevContainer (arm64)'
6653 runs-on : ubuntu-24.04-arm
67- permissions :
68- contents : read
69- packages : write
70- id-token : write
7154
7255 steps :
7356 - name : Checkout (GitHub)
8164 password : ${{ secrets.GITHUB_TOKEN }}
8265
8366 # Use .devcontainer from THIS repo for building and testing
84- - name : Check, Build, Test, Publish
67+ - name : Check, Build, Test
8568 uses : devcontainers/ci@v0.3
8669 with :
8770 # The .devcontainer is never published as pre-built container.
@@ -102,6 +85,34 @@ jobs:
10285 # Test
10386 ./scripts/test.sh
10487
88+ publish :
89+ needs : [build-arm64, build-x86_64]
90+ name : ' Publish'
91+ runs-on : ubuntu-24.04
92+ permissions :
93+ contents : read
94+ packages : write
95+ id-token : write
96+ steps :
97+ - name : Checkout (GitHub)
98+ uses : actions/checkout@v3
99+
100+ - name : Login to GitHub Container Registry
101+ uses : docker/login-action@v2
102+ with :
103+ registry : ghcr.io
104+ username : ${{ github.actor }}
105+ password : ${{ secrets.GITHUB_TOKEN }}
106+
107+ - name : Publish
108+ uses : devcontainers/ci@v0.3
109+ with :
110+ # The .devcontainer is never published as pre-built container.
111+ # We want to only use it for building and testing the actual container, which resides in src/s-core-devcontainer.
112+ push : " never"
113+ runCmd : |
114+ set -eux pipefail
115+
105116 # Optionally: Publish
106117 # We do not use the push feature of devcontainers/ci here, since that would push the wrong container.
107118 # Instead, we use the publish script which pushes the correct container (residing in src/s-core-devcontainer).
0 commit comments