Reference py-canon's auto-merge instead of copying it (#72) #87
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: Deploy to Cloud Run | |
| on: | |
| push: | |
| branches: | |
| - main | |
| release: | |
| types: [published] | |
| env: | |
| PROJECT_ID: sawasdee-189716 | |
| SERVICE_NAME: rmcp-server | |
| REGION: us-central1 | |
| AR_REGION: us-central1 | |
| AR_REPO: rmcp-repo | |
| GHCR_IMAGE: ghcr.io/finite-sample/rmcp/rmcp-ci:production-latest | |
| AR_IMAGE: us-central1-docker.pkg.dev/sawasdee-189716/rmcp-repo/rmcp-server:latest | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Verify RMCP_API_KEY secret is configured | |
| env: | |
| RMCP_API_KEY: ${{ secrets.RMCP_API_KEY }} | |
| run: | | |
| if [ -z "$RMCP_API_KEY" ]; then | |
| echo "::error::RMCP_API_KEY secret is not set. The server refuses to serve /mcp unauthenticated on a remote bind, so the Cloud Run revision would fail its health check. Set the secret with: gh secret set RMCP_API_KEY" | |
| exit 1 | |
| fi | |
| - name: Authenticate to Google Cloud | |
| uses: google-github-actions/auth@v3 | |
| with: | |
| credentials_json: ${{ secrets.GCP_SA_KEY }} | |
| - name: Set up Cloud SDK | |
| uses: google-github-actions/setup-gcloud@v3 | |
| - name: Configure Docker for Artifact Registry | |
| run: | | |
| gcloud auth configure-docker $AR_REGION-docker.pkg.dev | |
| - name: Pull image from GitHub Container Registry | |
| run: | | |
| docker pull $GHCR_IMAGE | |
| - name: Tag and push to Artifact Registry | |
| run: | | |
| docker tag $GHCR_IMAGE $AR_IMAGE | |
| docker push $AR_IMAGE | |
| - name: Deploy to Cloud Run | |
| env: | |
| RMCP_API_KEY: ${{ secrets.RMCP_API_KEY }} | |
| run: | | |
| gcloud run deploy $SERVICE_NAME \ | |
| --image $AR_IMAGE \ | |
| --region $REGION \ | |
| --platform managed \ | |
| --allow-unauthenticated \ | |
| --command rmcp \ | |
| --args serve-http,--host,0.0.0.0,--port,8080 \ | |
| --set-env-vars "RMCP_API_KEY=$RMCP_API_KEY" \ | |
| --port 8080 \ | |
| --memory 2Gi \ | |
| --timeout 300 |