release-image.yml•2.08 kB
name: Release as container image
on:
push:
branches:
- main
tags:
- '*'
env:
IMAGE_NAME: quay.io/manusa/kubernetes_mcp_server
TAG: ${{ github.ref_name == 'main' && 'latest' || github.ref_type == 'tag' && github.ref_name && startsWith(github.ref_name, 'v') && github.ref_name || 'unknown' }}
jobs:
publish-platform-images:
name: 'Publish: linux-${{ matrix.platform.tag }}'
strategy:
fail-fast: true
matrix:
platform:
- runner: ubuntu-latest
tag: amd64
- runner: ubuntu-24.04-arm
tag: arm64
runs-on: ${{ matrix.platform.runner }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Podman # Not available in arm64 image
run: |
sudo apt-get update
sudo apt-get install -y podman
- name: Quay Login
run: |
echo ${{ secrets.QUAY_PASSWORD }} | podman login quay.io -u ${{ secrets.QUAY_USERNAME }} --password-stdin
- name: Build Image
run: |
podman build \
--platform "linux/${{ matrix.platform.tag }}" \
-f Dockerfile \
-t "${{ env.IMAGE_NAME }}:${{ env.TAG }}-linux-${{ matrix.platform.tag }}" \
.
- name: Push Image
run: |
podman push \
"${{ env.IMAGE_NAME }}:${{ env.TAG }}-linux-${{ matrix.platform.tag }}"
publish-manifest:
name: Publish Manifest
runs-on: ubuntu-latest
needs: publish-platform-images
steps:
- name: Quay Login
run: |
echo ${{ secrets.QUAY_PASSWORD }} | podman login quay.io -u ${{ secrets.QUAY_USERNAME }} --password-stdin
- name: Create Manifest
run: |
podman manifest create \
"${{ env.IMAGE_NAME }}:${{ env.TAG }}" \
"${{ env.IMAGE_NAME }}:${{ env.TAG }}-linux-amd64" \
"${{ env.IMAGE_NAME }}:${{ env.TAG }}-linux-arm64"
- name: Push Manifest
run: |
podman manifest push \
"${{ env.IMAGE_NAME }}:${{ env.TAG }}"