Skip to content

Commit 83bad69

Browse files
committed
ci: publish as container image
1 parent d5cacb9 commit 83bad69

File tree

1 file changed

+64
-0
lines changed

1 file changed

+64
-0
lines changed

.github/workflows/release-image.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Release as container image
2+
3+
on:
4+
push:
5+
# TODO publish on tag
6+
branches:
7+
- main
8+
9+
env:
10+
IMAGE_NAME: quay.io/manusa/kubernetes_mcp_server
11+
TAG: latest
12+
13+
jobs:
14+
publish-platform-images:
15+
name: 'Publish: linux-${{ matrix.platform.tag }}'
16+
strategy:
17+
fail-fast: true
18+
matrix:
19+
platform:
20+
- runner: ubuntu-latest
21+
tag: amd64
22+
- runner: ubuntu-24.04-arm
23+
tag: arm64
24+
runs-on: ${{ matrix.platform.runner }}
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v4
28+
- name: Install Podman # Not available in arm64 image
29+
run: |
30+
sudo apt-get update
31+
sudo apt-get install -y podman
32+
- name: Quay Login
33+
run: |
34+
echo ${{ secrets.QUAY_PASSWORD }} | podman login quay.io -u ${{ secrets.QUAY_USERNAME }} --password-stdin
35+
- name: Build Image
36+
run: |
37+
podman build \
38+
--platform "linux/${{ matrix.platform.tag }}" \
39+
-f Dockerfile \
40+
-t "${{ env.IMAGE_NAME }}:${{ env.TAG }}-linux-${{ matrix.platform.tag }}" \
41+
.
42+
- name: Push Image
43+
run: |
44+
podman push \
45+
"${{ env.IMAGE_NAME }}:${{ env.TAG }}-linux-${{ matrix.platform.tag }}"
46+
47+
publish-manifest:
48+
name: Publish Manifest
49+
runs-on: ubuntu-latest
50+
needs: publish-platform-images
51+
steps:
52+
- name: Quay Login
53+
run: |
54+
echo ${{ secrets.QUAY_PASSWORD }} | podman login quay.io -u ${{ secrets.QUAY_USERNAME }} --password-stdin
55+
- name: Create Manifest
56+
run: |
57+
podman manifest create \
58+
"${{ env.IMAGE_NAME }}:${{ env.TAG }}" \
59+
"${{ env.IMAGE_NAME }}:${{ env.TAG }}-linux-amd64" \
60+
"${{ env.IMAGE_NAME }}:${{ env.TAG }}-linux-arm64"
61+
- name: Push Manifest
62+
run: |
63+
podman manifest push \
64+
"${{ env.IMAGE_NAME }}:${{ env.TAG }}"

0 commit comments

Comments
 (0)