Skip to content

Add support for speck-kit (#31) #47

Add support for speck-kit (#31)

Add support for speck-kit (#31) #47

name: Build Multi-Platform Docker Images
on:
push:
branches: [master]
release:
types: [published]
workflow_dispatch:
env:
# GitHub Container Registry (default)
GHCR_REGISTRY: ghcr.io
GHCR_IMAGE_NAME: ${{ github.repository }}
GCP_REGISTRY: ${{ vars.GCP_REGISTRY || 'us-central1-docker.pkg.dev' }}
GCP_PROJECT_ID: ${{ vars.GCP_PROJECT_ID }}
GCP_REPOSITORY: ${{ vars.GCP_REPOSITORY || 'mcp-bzm-apitest' }}
jobs:
build-docker:
name: Build Multi-Platform Docker Image
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
actions: read
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.GHCR_REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Log in to Google Artifact Registry
if: env.GCP_PROJECT_ID != ''
uses: docker/login-action@v3
with:
registry: ${{ env.GCP_REGISTRY }}
username: _json_key
password: ${{ secrets.GCP_GAR_JSON_KEY }}
- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: |
${{ env.GHCR_REGISTRY }}/${{ env.GHCR_IMAGE_NAME }}
${{ env.GCP_PROJECT_ID != '' && format('{0}/{1}/{2}/mcp-bzm-apitest', env.GCP_REGISTRY, env.GCP_PROJECT_ID, env.GCP_REPOSITORY) || '' }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}},enable=${{ github.event_name == 'release' }}
type=semver,pattern={{major}}.{{minor}},enable=${{ github.event_name == 'release' }}
type=semver,pattern={{major}},enable=${{ github.event_name == 'release' }}
type=raw,value=latest,enable=${{ github.event_name == 'release' }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max