Skip to content

Commit bc3666b

Browse files
authored
Merge pull request #6290 from crazy-max/ubuntu-nvidia-push
ci: publish ubuntu variant with nvidia build tag
2 parents dcbb752 + 7b10db1 commit bc3666b

File tree

1 file changed

+26
-7
lines changed

1 file changed

+26
-7
lines changed

.github/workflows/buildkit.yml

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -161,22 +161,35 @@ 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-tags: 'nvidia venus'
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+
echo "TAG_SUFFIX=${tagSuffix}" >> $GITHUB_ENV
192+
if [[ $GITHUB_REF == refs/tags/v* ]] && [[ "${{ matrix.base }}" = "$DEFAULT_BASE" ]]; then
180193
if [[ "${GITHUB_REF#refs/tags/}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
181194
if [ -n "${{ matrix.target }}" ]; then
182195
echo "TAG_LATEST=${{ matrix.target }}" >> $GITHUB_ENV
@@ -208,15 +221,19 @@ jobs:
208221
### moby/buildkit:latest
209222
### moby/buildkit:v0.24.0-rootless
210223
### moby/buildkit:rootless
224+
### moby/buildkit:v0.24.0-ubuntu
211225
## push semver prerelease tag v0.24.0-rc1
212226
### moby/buildkit:v0.24.0-rc1
213227
### moby/buildkit:v0.24.0-rc1-rootless
228+
### moby/buildkit:v0.24.0-rc1-ubuntu
214229
## push on master
215230
### moby/buildkit:master
216231
### moby/buildkit:master-rootless
232+
### moby/buildkit:master-ubuntu
217233
## scheduled event on master
218234
### moby/buildkit:nightly
219235
### moby/buildkit:nightly-rootless
236+
### moby/buildkit:nightly-ubuntu
220237
tags: |
221238
type=schedule,pattern=nightly,suffix=${{ env.TAG_SUFFIX }}
222239
type=ref,event=branch,suffix=${{ env.TAG_SUFFIX }}
@@ -251,11 +268,13 @@ jobs:
251268
provenance: mode=max,version=v1
252269
sbom: true
253270
set: |
254-
*.cache-from=type=gha,scope=image${{ matrix.target }}
255-
*.cache-to=type=gha,scope=image${{ matrix.target }}
271+
*.cache-from=type=gha,scope=image${{ matrix.target }}-${{ matrix.base }}
272+
*.cache-to=type=gha,scope=image${{ matrix.target }}-${{ matrix.base }}
256273
*.no-cache-filter=${{ (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v')) && 'buildkit-export-alpine,buildkit-export-ubuntu,gobuild-base,rootless' || '' }}
257274
env:
258275
IMAGE_TARGET: ${{ matrix.target }}
276+
EXPORT_BASE: ${{ matrix.base }}
277+
BUILDKITD_TAGS: ${{ matrix.build-tags }}
259278

260279
scout:
261280
runs-on: ubuntu-24.04

0 commit comments

Comments
 (0)