name: Publish Docker images on: push: tags: - "v*" workflow_dispatch: permissions: contents: read packages: write env: REGISTRY: ghcr.io IMAGE_NAMESPACE: ${{ github.repository_owner }} jobs: build: name: ${{ matrix.image }} runs-on: ubuntu-latest strategy: fail-fast: false matrix: include: - image: whatsapp-mcp-go-bridge context: ./whatsapp-bridge - image: whatsapp-mcp-go-server context: ./whatsapp-mcp-server steps: - name: Checkout uses: actions/checkout@v6 - name: Set up QEMU uses: docker/setup-qemu-action@v4 - name: Set up Buildx uses: docker/setup-buildx-action@v4 - name: Log in to GHCR uses: docker/login-action@v4 with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Extract metadata id: meta uses: docker/metadata-action@v6 with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAMESPACE }}/${{ matrix.image }} tags: | type=semver,pattern={{version}} type=raw,value=latest - name: Build and push uses: docker/build-push-action@v7 with: context: ${{ matrix.context }} platforms: linux/amd64,linux/arm64 push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} cache-from: type=gha,scope=${{ matrix.image }} cache-to: type=gha,mode=max,scope=${{ matrix.image }} provenance: false