Skip to content

Commit a7e1d96

Browse files
committed
ci: publish both ubuntu and alpine variants
Signed-off-by: CrazyMax <[email protected]>
1 parent 5460e90 commit a7e1d96

File tree

2 files changed

+24
-5
lines changed

2 files changed

+24
-5
lines changed

.github/workflows/buildkit.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,10 @@ jobs:
188188
strategy:
189189
fail-fast: false
190190
matrix:
191-
target-stage:
191+
base:
192+
- ''
193+
- alpine
194+
target:
192195
- ''
193196
- rootless
194197
steps:
@@ -221,9 +224,10 @@ jobs:
221224
./hack/images "${{ needs.prepare.outputs.tag }}" "$IMAGE_NAME" "${{ needs.prepare.outputs.push }}"
222225
env:
223226
RELEASE: ${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v') }}
224-
TARGET: ${{ matrix.target-stage }}
225-
CACHE_FROM: type=gha,scope=image${{ matrix.target-stage }}
226-
CACHE_TO: type=gha,scope=image${{ matrix.target-stage }}
227+
BASE: ${{ matrix.base }}
228+
TARGET: ${{ matrix.target }}
229+
CACHE_FROM: type=gha,scope=image${{ matrix.target }}
230+
CACHE_TO: type=gha,scope=image${{ matrix.target }}
227231
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
228232

229233
scout:

hack/images

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ set -eu -o pipefail
99

1010
: "${RELEASE=false}"
1111
: "${PLATFORMS=}"
12+
: "${BASE=}"
1213
: "${TARGET=}"
1314

1415
versionTag=$(git describe --always --tags --match "v[0-9]*")
@@ -70,16 +71,30 @@ if [ -n "$TARGET" ]; then
7071
targetFlag="--target=$TARGET"
7172
fi
7273

74+
exportBaseArg=""
75+
if [ -n "$BASE" ]; then
76+
exportBaseArg="--build-arg=EXPORT_BASE=$BASE"
77+
fi
78+
7379
tagNames="$REPO:$TAG"
7480
if [ -n "$TARGET" ]; then
7581
tagNames="$tagNames-$TARGET"
7682
fi
83+
if [ -n "$BASE" ]; then
84+
tagNames="$tagNames-$BASE"
85+
fi
7786

7887
if [[ "$versionTag" == "$TAG" ]]; then
7988
if [ -n "$TARGET" ]; then
8089
tagNames="$tagNames $REPO:$TARGET"
90+
if [ -n "$BASE" ]; then
91+
tagNames="$tagNames-$BASE"
92+
fi
8193
else
8294
tagNames="$tagNames $REPO:latest"
95+
if [ -n "$BASE" ]; then
96+
tagNames="$tagNames-$BASE"
97+
fi
8398
fi
8499
fi
85100

@@ -111,5 +126,5 @@ if [[ "$RELEASE" = "true" ]] && [[ "$GITHUB_ACTIONS" = "true" ]]; then
111126
nocacheFilterFlag="--no-cache-filter=buildkit-export,gobuild-base,rootless"
112127
fi
113128

114-
buildxCmd build --build-arg "BUILDKIT_CONTEXT_KEEP_GIT_DIR=1" --build-arg BUILDKITD_TAGS --build-arg BUILDKIT_DEBUG --build-arg EXPORT_BASE $platformFlag $targetFlag $importCacheFlags $exportCacheFlags $tagFlags $outputFlag $nocacheFilterFlag $attestFlags \
129+
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 \
115130
$currentcontext

0 commit comments

Comments
 (0)