diff --git a/.github/workflows/gandora-mcp.yml b/.github/workflows/gandora-mcp.yml index 02728f1..0d86322 100644 --- a/.github/workflows/gandora-mcp.yml +++ b/.github/workflows/gandora-mcp.yml @@ -23,17 +23,21 @@ jobs: 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, cloudflare as c + import json, os, cloudflare as c from pathlib import Path name = "gandora-mcp" - meta = {"main_module": "worker.js", "compatibility_date": c.COMPAT, "bindings": []} + 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) @@ -42,13 +46,8 @@ jobs: PY - name: check run: | - for i in 1 2 3 4 5 6 7 8; do - if curl -fsS https://gandora-mcp.yolopreneur.lol/health; then - echo - curl -fsS -X POST https://gandora-mcp.yolopreneur.lol/mcp -H 'content-type: application/json' \ - -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' | head -c 600; echo - exit 0 - fi + 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