Skip to content

Commit 2fbe19b

Browse files
authored
Fix kroxylicious#2222: Github workflow to make a multi-arch kaf container. (kroxylicious#2322)
* Fix kroxylicious#2222: Github workflow to make a multi-arch kaf container. Signed-off-by: Keith Wall <kwall@apache.org> * addressing review feedback Signed-off-by: Keith Wall <kwall@apache.org> --------- Signed-off-by: Keith Wall <kwall@apache.org>
1 parent 329431b commit 2fbe19b

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

.github/workflows/kaf.yaml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# kaf.yaml - builds and pushes a Kaf container image.
2+
#
3+
# Requires repository variables:
4+
# - REGISTRY_SERVER - the server of the container registry service e.g. `quay.io` or `docker.io`
5+
# - REGISTRY_USERNAME - - your username on the service (or username of your robot account)
6+
# - REGISTRY_TOKEN - the access token that corresponds to `REGISTRY_USERNAME`
7+
#
8+
9+
name: Kaf Container
10+
on:
11+
workflow_dispatch:
12+
inputs:
13+
repository:
14+
description: 'Repository containing kaf'
15+
default: 'birdayz/kaf'
16+
required: true
17+
registry-destination:
18+
description: 'The release version, e.g. quay.io/<my org>/kaf'
19+
default: 'quay.io/kroxylicious/kaf'
20+
required: true
21+
ref:
22+
description: 'Ref (branch/tag) to build'
23+
required: true
24+
default: 'master'
25+
jobs:
26+
build:
27+
runs-on: ubuntu-latest
28+
if: ${{ vars.REGISTRY_SERVER != '' && vars.REGISTRY_USERNAME != '' }}
29+
steps:
30+
- name: Checkout
31+
uses: actions/checkout@v4
32+
with:
33+
repository: ${{ github.event.inputs.repository }}
34+
ref: ${{ github.event.inputs.ref }}
35+
- name: Set up QEMU
36+
uses: docker/setup-qemu-action@v3
37+
- name: Set up Docker Buildx
38+
id: buildx
39+
uses: docker/setup-buildx-action@v3
40+
- name: Login to container registry
41+
uses: docker/login-action@v3
42+
with:
43+
registry: ${{ vars.REGISTRY_SERVER }}
44+
username: ${{ vars.REGISTRY_USERNAME }}
45+
password: ${{ secrets.REGISTRY_TOKEN }}
46+
- name: Build and push Kaf container image
47+
uses: docker/build-push-action@v6
48+
with:
49+
context: .
50+
platforms: linux/amd64,linux/arm64,linux/s390x,linux/ppc64le
51+
push: true
52+
tags: ${{ github.event.inputs.registry-destination }}:${{ github.event.inputs.ref }}
53+
cache-from: type=gha
54+
cache-to: type=gha,mode=max,compression=zstd

0 commit comments

Comments
 (0)