Skip to content

ci: add optional Cloud Run deploy job (gated on repo vars)#43

Closed
ochafik wants to merge 1 commit intomainfrom
infra/cloud-run-deploy
Closed

ci: add optional Cloud Run deploy job (gated on repo vars)#43
ochafik wants to merge 1 commit intomainfrom
infra/cloud-run-deploy

Conversation

@ochafik
Copy link
Copy Markdown
Contributor

@ochafik ochafik commented Apr 23, 2026

Summary

Adds a deploy job that ships to Cloud Run on push to main, gated on vars.GCP_PROJECT_ID so it's a no-op here and in forks. A downstream mirror can enable it by setting repo variables — no workflow diff to carry across rebases.

Includes --memory=1Gi (the 512Mi default sat at ~97% under load and caused multi-second GC stalls).

Required repo variables (in the deploying mirror only)

Variable Example
GCP_PROJECT_ID mcp-server-everything
GCP_WIF_PROVIDER projects/NNN/locations/global/workloadIdentityPools/github-actions-pool/providers/github-provider
CLOUD_RUN_SERVICE mcp-server-everything
CLOUD_RUN_REGION us-central1
BASE_URI https://example-server.modelcontextprotocol.io/
CLOUD_RUN_VPC_CONNECTOR redis-connector
CLOUD_RUN_SERVICE_ACCOUNT cloudrun-service@PROJECT.iam.gserviceaccount.com

Also requires a REDIS_URL secret in GCP Secret Manager and a WIF provider configured to trust the deploying repo.

Test plan

  • CI on this PR: deploy job is skipped (condition false)
  • In deploying mirror: set the 7 vars, merge, confirm Cloud Run revision deploys with 1Gi memory

The deploy job is skipped unless GCP_PROJECT_ID is set as a repository
variable, so it is a no-op for the public repo and forks. A downstream
mirror that sets the required variables (GCP_PROJECT_ID,
GCP_WIF_PROVIDER, CLOUD_RUN_SERVICE, CLOUD_RUN_REGION, BASE_URI,
CLOUD_RUN_VPC_CONNECTOR, CLOUD_RUN_SERVICE_ACCOUNT) gets automatic
deploys on push to main without carrying a workflow diff.

Sets --memory=1Gi since the default 512Mi was running at 95-98%
utilization under typical load.
@ochafik
Copy link
Copy Markdown
Contributor Author

ochafik commented Apr 23, 2026

Keeping deploy config in the downstream fork instead — closing.

@ochafik ochafik closed this Apr 23, 2026
@ochafik ochafik deleted the infra/cloud-run-deploy branch April 23, 2026 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant