Skip to content

Commit 5d94f62

Browse files
committed
ci: publish nvidia tag variant for ubuntu
Signed-off-by: CrazyMax <[email protected]>
1 parent 3fc3d90 commit 5d94f62

File tree

2 files changed

+41
-6
lines changed

2 files changed

+41
-6
lines changed

.github/workflows/buildkit.yml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -188,12 +188,20 @@ jobs:
188188
strategy:
189189
fail-fast: false
190190
matrix:
191-
base:
192-
- ''
193-
- alpine
194-
target:
195-
- ''
196-
- rootless
191+
include:
192+
-
193+
base: 'ubuntu'
194+
-
195+
base: 'ubuntu'
196+
target: 'rootless'
197+
-
198+
base: 'ubuntu'
199+
build-tag: 'nvidia'
200+
-
201+
base: 'alpine'
202+
-
203+
base: 'alpine'
204+
target: 'rootless'
197205
steps:
198206
-
199207
name: Checkout
@@ -226,6 +234,7 @@ jobs:
226234
RELEASE: ${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v') }}
227235
BASE: ${{ matrix.base }}
228236
TARGET: ${{ matrix.target }}
237+
BUILD_TAG: ${{ matrix.build-tag }}
229238
CACHE_FROM: type=gha,scope=image${{ matrix.target }}
230239
CACHE_TO: type=gha,scope=image${{ matrix.target }}
231240
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

hack/images

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ set -eu -o pipefail
1111
: "${PLATFORMS=}"
1212
: "${BASE=}"
1313
: "${TARGET=}"
14+
: "${BUILD_TAG=}"
1415

16+
defaultBase="ubuntu"
1517
versionTag=$(git describe --always --tags --match "v[0-9]*")
1618

1719
if [[ ! "$versionTag" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
@@ -83,18 +85,36 @@ fi
8385
if [ -n "$BASE" ]; then
8486
tagNames="$tagNames-$BASE"
8587
fi
88+
if [ -n "$BUILD_TAG" ]; then
89+
tagNames="$tagNames-$BUILD_TAG"
90+
fi
91+
if [ "$BASE" = "$defaultBase" ]; then
92+
tagNames="$tagNames $REPO:$TAG"
93+
fi
8694

8795
if [[ "$versionTag" == "$TAG" ]]; then
8896
if [ -n "$TARGET" ]; then
8997
tagNames="$tagNames $REPO:$TARGET"
9098
if [ -n "$BASE" ]; then
9199
tagNames="$tagNames-$BASE"
92100
fi
101+
if [ -n "$BUILD_TAG" ]; then
102+
tagNames="$tagNames-$BUILD_TAG"
103+
fi
104+
if [ "$BASE" = "$defaultBase" ]; then
105+
tagNames="$tagNames $REPO:$TARGET"
106+
fi
93107
else
94108
tagNames="$tagNames $REPO:latest"
95109
if [ -n "$BASE" ]; then
96110
tagNames="$tagNames-$BASE"
97111
fi
112+
if [ -n "$BUILD_TAG" ]; then
113+
tagNames="$tagNames-$BUILD_TAG"
114+
fi
115+
if [ "$BASE" = "$defaultBase" ]; then
116+
tagNames="$tagNames $REPO:latest"
117+
fi
98118
fi
99119
fi
100120

@@ -126,5 +146,11 @@ if [[ "$RELEASE" = "true" ]] && [[ "$GITHUB_ACTIONS" = "true" ]]; then
126146
nocacheFilterFlag="--no-cache-filter=buildkit-export,gobuild-base,rootless"
127147
fi
128148

149+
if [ -n "$BUILD_TAG" ]; then
150+
[ -n "$BUILDKITD_TAGS" ] && BUILDKITD_TAGS="$BUILDKITD_TAGS "
151+
BUILDKITD_TAGS="$BUILDKITD_TAGS$BUILD_TAG"
152+
export BUILDKITD_TAGS
153+
fi
154+
129155
buildxCmd build --build-arg "BUILDKIT_CONTEXT_KEEP_GIT_DIR=1" --build-arg BUILDKITD_TAGS --build-arg BUILDKIT_DEBUG $exportBaseArg $platformFlag $targetFlag $importCacheFlags $exportCacheFlags $tagFlags $outputFlag $nocacheFilterFlag $attestFlags \
130156
$currentcontext

0 commit comments

Comments
 (0)