Skip to content

Commit b79407a

Browse files
committed
ci: publish ubuntu variant with nvidia build tag
Signed-off-by: CrazyMax <[email protected]>
1 parent 395b2f8 commit b79407a

File tree

1 file changed

+29
-7
lines changed

1 file changed

+29
-7
lines changed

.github/workflows/buildkit.yml

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -161,22 +161,38 @@ jobs:
161161

162162
image:
163163
runs-on: ubuntu-24.04
164+
env:
165+
DEFAULT_BASE: alpine
164166
needs:
165167
- test
166168
strategy:
167169
fail-fast: false
168170
matrix:
169-
target:
170-
- ''
171-
- rootless
171+
include:
172+
-
173+
base: 'alpine'
174+
-
175+
base: 'alpine'
176+
target: 'rootless'
177+
-
178+
base: 'ubuntu'
179+
build-tag: 'nvidia'
172180
steps:
173181
-
174182
name: Prepare
175183
run: |
184+
tagSuffix=""
176185
if [ -n "${{ matrix.target }}" ]; then
177-
echo "TAG_SUFFIX=-${{ matrix.target }}" >> $GITHUB_ENV
186+
tagSuffix="${tagSuffix}-${{ matrix.target }}"
178187
fi
179-
if [[ $GITHUB_REF == refs/tags/v* ]]; then
188+
if [ "${{ matrix.base }}" != "$DEFAULT_BASE" ]; then
189+
tagSuffix="${tagSuffix}-${{ matrix.base }}"
190+
fi
191+
if [ -n "${{ matrix.build-tag }}" ]; then
192+
tagSuffix="${tagSuffix}-${{ matrix.build-tag }}"
193+
fi
194+
echo "TAG_SUFFIX=${tagSuffix}" >> $GITHUB_ENV
195+
if [[ $GITHUB_REF == refs/tags/v* ]] && [[ "${{ matrix.base }}" = "$DEFAULT_BASE" ]] && [[ -z "${{ matrix.build-tag }}" ]]; then
180196
if [[ "${GITHUB_REF#refs/tags/}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
181197
if [ -n "${{ matrix.target }}" ]; then
182198
echo "TAG_LATEST=${{ matrix.target }}" >> $GITHUB_ENV
@@ -208,15 +224,19 @@ jobs:
208224
### moby/buildkit:latest
209225
### moby/buildkit:v0.24.0-rootless
210226
### moby/buildkit:rootless
227+
### moby/buildkit:v0.24.0-ubuntu-nvidia
211228
## push semver prerelease tag v0.24.0-rc1
212229
### moby/buildkit:v0.24.0-rc1
213230
### moby/buildkit:v0.24.0-rc1-rootless
231+
### moby/buildkit:v0.24.0-rc1-ubuntu-nvidia
214232
## push on master
215233
### moby/buildkit:master
216234
### moby/buildkit:master-rootless
235+
### moby/buildkit:master-ubuntu-nvidia
217236
## scheduled event on master
218237
### moby/buildkit:nightly
219238
### moby/buildkit:nightly-rootless
239+
### moby/buildkit:nightly-ubuntu-nvidia
220240
tags: |
221241
type=schedule,pattern=nightly,suffix=${{ env.TAG_SUFFIX }}
222242
type=ref,event=branch,suffix=${{ env.TAG_SUFFIX }}
@@ -251,11 +271,13 @@ jobs:
251271
provenance: mode=max,version=v1
252272
sbom: true
253273
set: |
254-
*.cache-from=type=gha,scope=image${{ matrix.target }}
255-
*.cache-to=type=gha,scope=image${{ matrix.target }}
274+
*.cache-from=type=gha,scope=image${{ matrix.target }}-${{ matrix.base }}${{ matrix.build-tag }}
275+
*.cache-to=type=gha,scope=image${{ matrix.target }}-${{ matrix.base }}${{ matrix.build-tag }}
256276
*.no-cache-filter=${{ (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v')) && 'buildkit-export-alpine,buildkit-export-ubuntu,gobuild-base,rootless' || '' }}
257277
env:
258278
IMAGE_TARGET: ${{ matrix.target }}
279+
EXPORT_BASE: ${{ matrix.base }}
280+
BUILDKITD_TAGS: ${{ matrix.build-tag }}
259281

260282
scout:
261283
runs-on: ubuntu-24.04

0 commit comments

Comments
 (0)