Skip to content

Commit 3b5309a

Browse files
committed
ci: publish multi-arch supervisor image on mvp branch
Add build-and-push-supervisor job to publish.yml so the supervisor image is built for linux/amd64 and linux/arm64 and pushed to ghcr.io/kagenti/openshell/supervisor on every push to main/mvp. Also scope the GHA build cache by job (gateway vs supervisor) to prevent cache key collisions between the two parallel jobs. Assisted-By: Claude (Anthropic AI) <noreply@anthropic.com> Signed-off-by: Paolo Dettori <dettori@us.ibm.com>
1 parent 62dc47e commit 3b5309a

1 file changed

Lines changed: 71 additions & 6 deletions

File tree

.github/workflows/publish.yml

Lines changed: 71 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Publish Gateway Image
1+
name: Publish Images
22

33
on:
44
push:
@@ -14,7 +14,6 @@ permissions: {}
1414

1515
env:
1616
REGISTRY: ghcr.io
17-
IMAGE_NAME: ghcr.io/kagenti/openshell/gateway
1817

1918
jobs:
2019
build-and-push:
@@ -47,7 +46,7 @@ jobs:
4746
uses: docker/metadata-action@030e881283bb7a6894de51c315a6bfe6a94e05cf # v6.0.0
4847
continue-on-error: true
4948
with:
50-
images: ${{ env.IMAGE_NAME }}
49+
images: ghcr.io/kagenti/openshell/gateway
5150
tags: |
5251
type=ref,event=tag
5352
type=sha,prefix={{branch}}-,enable=${{ github.ref_type != 'tag' }}
@@ -64,7 +63,7 @@ jobs:
6463
if: steps.meta.outcome == 'failure'
6564
uses: docker/metadata-action@030e881283bb7a6894de51c315a6bfe6a94e05cf # v6.0.0
6665
with:
67-
images: ${{ env.IMAGE_NAME }}
66+
images: ghcr.io/kagenti/openshell/gateway
6867
tags: |
6968
type=ref,event=tag
7069
type=sha,prefix={{branch}}-,enable=${{ github.ref_type != 'tag' }}
@@ -80,5 +79,71 @@ jobs:
8079
platforms: linux/amd64,linux/arm64
8180
tags: ${{ steps.meta_retry.outputs.tags || steps.meta.outputs.tags }}
8281
labels: ${{ steps.meta_retry.outputs.labels || steps.meta.outputs.labels }}
83-
cache-from: type=gha
84-
cache-to: type=gha,mode=max
82+
cache-from: type=gha,scope=gateway
83+
cache-to: type=gha,scope=gateway,mode=max
84+
85+
build-and-push-supervisor:
86+
runs-on: ubuntu-latest
87+
timeout-minutes: 45
88+
89+
permissions:
90+
contents: read
91+
packages: write
92+
93+
steps:
94+
- name: Checkout repository
95+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
96+
97+
- name: Set up QEMU
98+
uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a # v4.0.0
99+
100+
- name: Set up Docker Buildx
101+
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0
102+
103+
- name: Log in to ghcr.io
104+
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0
105+
with:
106+
registry: ghcr.io
107+
username: ${{ github.actor }}
108+
password: ${{ secrets.GITHUB_TOKEN }}
109+
110+
- name: Extract Docker metadata
111+
id: meta
112+
uses: docker/metadata-action@030e881283bb7a6894de51c315a6bfe6a94e05cf # v6.0.0
113+
continue-on-error: true
114+
with:
115+
images: ghcr.io/kagenti/openshell/supervisor
116+
tags: |
117+
type=ref,event=tag
118+
type=sha,prefix={{branch}}-,enable=${{ github.ref_type != 'tag' }}
119+
type=raw,value=latest,enable=${{ (github.ref_type == 'tag' && startsWith(github.ref_name, 'v')) || github.event_name == 'workflow_dispatch' || github.ref == 'refs/heads/main' }}
120+
121+
- name: Wait before retry
122+
if: steps.meta.outcome == 'failure'
123+
run: |
124+
echo "Metadata extraction failed, retrying in 15s..."
125+
sleep 15
126+
127+
- name: Retry Docker metadata
128+
id: meta_retry
129+
if: steps.meta.outcome == 'failure'
130+
uses: docker/metadata-action@030e881283bb7a6894de51c315a6bfe6a94e05cf # v6.0.0
131+
with:
132+
images: ghcr.io/kagenti/openshell/supervisor
133+
tags: |
134+
type=ref,event=tag
135+
type=sha,prefix={{branch}}-,enable=${{ github.ref_type != 'tag' }}
136+
type=raw,value=latest,enable=${{ (github.ref_type == 'tag' && startsWith(github.ref_name, 'v')) || github.event_name == 'workflow_dispatch' || github.ref == 'refs/heads/main' }}
137+
138+
- name: Build and push supervisor image
139+
uses: docker/build-push-action@bcafcacb16a39f128d818304e6c9c0c18556b85f # v7.1.0
140+
with:
141+
context: .
142+
file: deploy/docker/Dockerfile.images
143+
target: supervisor
144+
push: true
145+
platforms: linux/amd64,linux/arm64
146+
tags: ${{ steps.meta_retry.outputs.tags || steps.meta.outputs.tags }}
147+
labels: ${{ steps.meta_retry.outputs.labels || steps.meta.outputs.labels }}
148+
cache-from: type=gha,scope=supervisor
149+
cache-to: type=gha,scope=supervisor,mode=max

0 commit comments

Comments
 (0)