-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (61 loc) · 2.08 KB
/
Copy pathdeploy.yml
File metadata and controls
71 lines (61 loc) · 2.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Deploy MCP to Cloud Run
# Auto-deploy the hosted Clockchain MCP server (mcp.clockchain.network) on push to
# main. Keyless auth via Workload Identity Federation (no SA key stored in GitHub).
# `gcloud run deploy --source` preserves the service's existing env/secrets/scaling.
on:
push:
branches: [main]
paths:
# Only packages baked into the deployed image trigger a redeploy.
# Other workspaces (clock-sdk, web-demo, verify) + docs/examples do NOT.
- "packages/mcp-server/**"
- "packages/core/**"
- "Dockerfile"
- ".dockerignore"
- "package.json"
- "package-lock.json"
- ".github/workflows/deploy.yml"
workflow_dispatch: {}
permissions:
contents: read
id-token: write
concurrency:
group: deploy-cloud-run
cancel-in-progress: false
jobs:
# Gate the deploy on a green build + tests, so a compiling-but-broken image
# can never reach production.
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm install --no-audit --no-fund
- run: npm run build
- run: npm test
deploy:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- id: auth
uses: google-github-actions/auth@v2
with:
project_id: clockchain-mcp
workload_identity_provider: projects/886160542191/locations/global/workloadIdentityPools/github/providers/github-provider
service_account: gh-deploy@clockchain-mcp.iam.gserviceaccount.com
- uses: google-github-actions/setup-gcloud@v2
- name: Deploy to Cloud Run
run: |
gcloud run deploy clockchain-mcp \
--source . \
--region us-central1 \
--quiet
- name: Smoke test the deployment
run: |
URL=$(gcloud run services describe clockchain-mcp --region us-central1 --format='value(status.url)')
code=$(curl -s -o /dev/null -w '%{http_code}' "$URL/health")
echo "health -> $code"
test "$code" = "200"