Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014mBuCaQSgWwqhtzsmTBQuM
54 lines
2.4 KiB
YAML
54 lines
2.4 KiB
YAML
name: gandora-mcp
|
||
# Deploy the gandora MCP spike (gandora/site › dev › mcp/worker.js) as Worker `gandora-mcp` at gandora-mcp.yolopreneur.lol.
|
||
# Dispatch only. No bindings, no secrets in the worker: it serves public test clips. See gandora/site mcp/README.md.
|
||
on:
|
||
workflow_dispatch:
|
||
inputs:
|
||
ref:
|
||
description: gandora/site ref to deploy
|
||
default: dev
|
||
permissions:
|
||
contents: read
|
||
concurrency:
|
||
group: gandora-mcp
|
||
cancel-in-progress: false
|
||
jobs:
|
||
deploy:
|
||
runs-on: ubuntu-latest
|
||
timeout-minutes: 10
|
||
steps:
|
||
- uses: actions/checkout@v5
|
||
- name: deploy
|
||
env:
|
||
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
||
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID || 'dac3b11890319628eb5cd761445b63ee' }}
|
||
SRC_REF: ${{ inputs.ref || 'dev' }}
|
||
GANDORA_MCP_TOKEN: ${{ secrets.GANDORA_MCP_TOKEN }}
|
||
run: |
|
||
set -eu
|
||
[ -n "$CLOUDFLARE_API_TOKEN" ] || { echo "::error::CLOUDFLARE_API_TOKEN missing"; exit 1; }
|
||
[ -n "$GANDORA_MCP_TOKEN" ] || { echo "::error::GANDORA_MCP_TOKEN missing: the endpoint can spend render quota, so it is not deployed open"; exit 1; }
|
||
curl -fsSL "https://teahub.xyz/gandora/site/raw/branch/${SRC_REF}/mcp/worker.js" -o /tmp/worker.js
|
||
wc -c /tmp/worker.js
|
||
cd .github/time
|
||
python3 - <<'PY'
|
||
import json, os, cloudflare as c
|
||
from pathlib import Path
|
||
name = "gandora-mcp"
|
||
meta = {"main_module": "worker.js", "compatibility_date": c.COMPAT, "bindings": [
|
||
{"type": "service", "name": "INFERENCE", "service": "time-inference", "environment": "production"},
|
||
{"type": "secret_text", "name": "TOKEN", "text": os.environ["GANDORA_MCP_TOKEN"]}]}
|
||
data, ctype = c.multipart([("metadata", "application/json", json.dumps(meta).encode()),
|
||
("worker.js", "application/javascript+module", Path("/tmp/worker.js").read_bytes())])
|
||
c.cf("PUT", f"{c.account()}/workers/scripts/{name}", data=data, ctype=ctype)
|
||
print("uploaded", name)
|
||
print("domain", c.attach(name, "gandora-mcp.yolopreneur.lol"))
|
||
PY
|
||
- name: check
|
||
run: |
|
||
for i in $(seq 1 24); do
|
||
if curl -fsS https://gandora-mcp.yolopreneur.lol/health; then echo; exit 0; fi
|
||
sleep 10
|
||
done
|
||
echo "::error::gandora-mcp did not answer /health"; exit 1
|