Skip to content

Commit 0fcd7d3

Browse files
committed
cloud build for github-mcp-server
1 parent 95fb4e3 commit 0fcd7d3

File tree

1 file changed

+64
-0
lines changed

1 file changed

+64
-0
lines changed

cloudbuild.yaml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Cloud Build configuration for github-mcp-server
2+
# Builds the container image, pushes to Artifact Registry, and deploys to Cloud Run
3+
4+
substitutions:
5+
_REGION: us-west1
6+
_REPOSITORY: mcp
7+
_SERVICE: github-mcp-server
8+
_GITHUB_ENABLE_GITHUB_APP_AUTH: "true"
9+
_GITHUB_APP_ID: "1230727"
10+
_GITHUB_HTTP_ADDRESS: "0.0.0.0:8080"
11+
_GITHUB_HTTP_MCP_PATH: "/mcp/"
12+
_GITHUB_APP_PRIVATE_KEY_SECRET: "quantstruct-canvas_github_app_private_key"
13+
14+
steps:
15+
# Build the image
16+
- id: "Build Docker image"
17+
name: "gcr.io/cloud-builders/docker"
18+
env:
19+
- "DOCKER_BUILDKIT=1"
20+
args:
21+
[
22+
"build",
23+
"-t",
24+
"$_REGION-docker.pkg.dev/$PROJECT_ID/$_REPOSITORY/$_SERVICE:$BUILD_ID",
25+
"-f",
26+
"Dockerfile",
27+
"--build-arg",
28+
"VERSION=$BUILD_ID",
29+
"."
30+
]
31+
32+
# Push the image to Artifact Registry
33+
- id: "Push Docker image"
34+
name: "gcr.io/cloud-builders/docker"
35+
args:
36+
[
37+
"push",
38+
"$_REGION-docker.pkg.dev/$PROJECT_ID/$_REPOSITORY/$_SERVICE:$BUILD_ID",
39+
]
40+
41+
# Deploy image to Cloud Run with env vars and secret
42+
- id: "Deploy to Cloud Run"
43+
name: "gcr.io/google.com/cloudsdktool/cloud-sdk"
44+
entrypoint: gcloud
45+
args:
46+
[
47+
"run",
48+
"deploy",
49+
"$_SERVICE",
50+
"--image",
51+
"$_REGION-docker.pkg.dev/$PROJECT_ID/$_REPOSITORY/$_SERVICE:$BUILD_ID",
52+
"--region",
53+
"$_REGION",
54+
"--platform",
55+
"managed",
56+
"--min",
57+
"1",
58+
"--port",
59+
"8080",
60+
"--set-env-vars",
61+
"GITHUB_ENABLE_GITHUB_APP_AUTH=$_GITHUB_ENABLE_GITHUB_APP_AUTH,GITHUB_APP_ID=$_GITHUB_APP_ID,GITHUB_HTTP_ADDRESS=$_GITHUB_HTTP_ADDRESS,GITHUB_HTTP_MCP_PATH=$_GITHUB_HTTP_MCP_PATH",
62+
"--set-secrets",
63+
"GITHUB_APP_PRIVATE_KEY=$_GITHUB_APP_PRIVATE_KEY_SECRET:latest"
64+
]

0 commit comments

Comments
 (0)