Api Monitoring MCP v1.1.0 #32
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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: Verify Linux binary exists in dist/ | |
| run: | | |
| if [ ! -f dist/mcp-bzm-apitest-linux-amd64 ]; then | |
| echo "ERROR: dist/mcp-bzm-apitest-linux-amd64 not found" | |
| exit 1 | |
| fi | |
| echo "AMD64 binary found" | |
| - 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 | |
| push: true | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max |