mirror of
https://github.com/anomalyco/opencode.git
synced 2026-11-20 18:57:17 +03:00
7bac5bad02
Repository code outside .github/ needs no review, but every deploy job held a Cloudflare token strong enough to write any Worker on the account (the data sync Workflow PUT has no per-Worker permission). A dev merge could therefore overwrite production Workers. Split each service into a build job with no environment, secrets, or OIDC token that uploads a SHA256SUMS artifact, and a deploy job in dev|production that checks out only .github/release/, verifies the artifact against the build job's digest, installs the cf/wrangler CLI pinned here, and runs only deploy-*.sh. The deploy scripts treat the artifact as data and refuse it unless its resolved config equals the pinned target in .github/release/targets/ exactly: Worker names, routes, custom domains, crons, Workflow names, and bindings. For cf services the pinned config is what cf reads. That is what makes an account-wide token safe, and it keeps production out of reach of a dev merge. Adds the cf 1.0.0-beta.12 and wrangler 4.110.0 lockfiles the deploy jobs install with npm ci --ignore-scripts.
39 lines
1.1 KiB
JSON
39 lines
1.1 KiB
JSON
{
|
|
"name": "opencode-site-dev",
|
|
"compatibilityDate": "2026-07-25",
|
|
"compatibilityFlags": ["nodejs_compat"],
|
|
"assets": {
|
|
"htmlHandling": "drop-trailing-slash",
|
|
"runWorkerFirst": [
|
|
"/docs",
|
|
"/docs/*",
|
|
"!/docs/_build/*",
|
|
"!/docs/assets/*",
|
|
"!/docs/pagefind/*",
|
|
"!/docs/favicon.svg",
|
|
"!/docs/llms.txt",
|
|
"!/docs/sitemap.xml",
|
|
"!/docs/openapi.json",
|
|
"/v1/docs",
|
|
"/v1/docs/*",
|
|
"!/v1/docs/assets/*",
|
|
"!/v1/docs/pagefind/*",
|
|
"!/v1/docs/llms.txt",
|
|
"!/v1/docs/theme.json"
|
|
]
|
|
},
|
|
"domains": ["dev.opencode.ai", "docs.dev.opencode.ai"],
|
|
"triggers": [
|
|
{ "type": "fetch", "pattern": "dev.opencode.ai", "zone": "opencode.ai" },
|
|
{ "type": "fetch", "pattern": "dev.opencode.ai/*", "zone": "opencode.ai" }
|
|
],
|
|
"observability": { "enabled": true },
|
|
"workersDev": false,
|
|
"previewUrls": false,
|
|
"env": {
|
|
"ASSETS": { "type": "assets" },
|
|
"STAGE": { "type": "text", "value": "dev" }
|
|
},
|
|
"manifest": { "type": "partial", "mainModule": "index.mjs", "modules": {} }
|
|
}
|