ThinkEx deploys from Cloudflare Workers Builds. GitHub Actions only validates pull requests. Deploy, migration, and secret-management commands are operational actions and should not be run casually from a local checkout.
Branches and Environments
Environment
URL
Worker
Trigger
Production
https://thinkex.app
thinkex
Push to main
Staging
https://staging.thinkex.app
thinkex-staging
Push to staging
CI
The CI workflow runs on pull requests only. It installs with Vite+ and runs check, test, and a staging-shaped build:
vp run ciCheck && vp run ciTest && vp run ciBuildStaging
ciBuildStaging compiles with CLOUDFLARE_ENV=staging so PR CI exercises real Wrangler env flattening. PostHog build secrets are optional for that path (analytics stays off when unset); production deploy still requires the full production PostHog set, including the feedback survey id. Local vp run verify stays on the generic ciBuild (build:app) so contributors without Infisical are unaffected. When changes go through a pull request, the validate check must be green before merge.The separate React Doctor workflow runs on pull requests and pushes to main. It scans changed React files on pull requests, posts inline diagnostics, and records the React Doctor score without folding those comments into the main Vite+ verification job.
Deploy
Two Workers Builds configurations watch this repository, one per branch. Each runs a build command, then a deploy command that applies Postgres migrations before shipping the Worker:
Branch
Build
Deploy
main
pnpm run build:production
pnpm run db:migrate && pnpm run deploy:worker
staging
pnpm run build:staging
pnpm run db:migrate:staging && pnpm run deploy:worker:staging
CLOUDFLARE_ENV is set per configuration in the Cloudflare dashboard, which is why deploy:worker takes no --env flag. Running it from a local checkout without that variable targets the thinkex-dev Worker, not production.Build variables and secrets (Cloudflare API token, PostHog production set) live in the Workers Builds settings. Each deployment configuration also needs the environment’s direct PlanetScale administrative connection string as the build-time DATABASE_URL; it is used only by Drizzle Kit and is not a Worker runtime secret. The Worker itself connects with the environment’s cache-disabled HYPERDRIVE binding and a restricted runtime database role.
Container Images
Production and staging pin container images to immutable registry.cloudflare.com digests (wrangler.jsonc), so ordinary deploys never need Docker and Workers Builds can run without a Docker daemon. The top-level config still points at the Dockerfiles for wrangler dev.The Dockerfiles change rarely, so there is no workflow for this. When one does change, rebuild and repin by hand from a machine with Docker:
Copy the digest from the second command into the containers blocks for both staging and production in wrangler.jsonc, then push. Both environments intentionally share one image per container.
Remote migrations and deploy commands affect shared environments. Run them only when you are intentionally doing release work.
Secrets
Runtime and deploy secrets originate in Infisical. Build-time secrets (Cloudflare credentials, PostHog variables) are set in each Workers Builds configuration; runtime secrets declared by the Worker configuration are set on the Worker itself. GitHub only holds what PR CI needs.Direct workspace uploads additionally require bucket-scoped R2 Object Read & Write credentials in R2_ACCESS_KEY_ID and R2_SECRET_ACCESS_KEY, R2_ACCOUNT_ID, and an independent random WORKSPACE_UPLOAD_TOKEN_SECRET for completion claims. Configure browser PUT access from the checked-in policies:
wrangler r2 bucket cors set thinkex-workspace-kernel-files-staging --file config/r2/cors.staging.jsonwrangler r2 bucket cors set thinkex-workspace-kernel-files --file config/r2/cors.production.json
After inspecting existing lifecycle rules, add a one-day expiry for abandoned direct-upload objects in each bucket:
CORS set replaces the bucket’s current CORS policy. Reconcile the checked-in policy with any existing rules before applying it.
Was this page helpful?
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"ThinkEx","description":"A workspace for source-heavy study, research, and creation.","colors":{"primary":"#5C8BD6","light":"#73BF7A","dark":"#0A0D0D"},"logo":{"light":"https://mintcdn.com/thinkexinc-ff642c69/8W5ZwixJ0_jSRSo9/assets/thinkex-logo-wordmark-light.svg?fit=max\u0026auto=format\u0026n=8W5ZwixJ0_jSRSo9\u0026q=85\u0026s=fd1e0d5a90eb267d80d9e47940ce59c1","dark":"https://mintcdn.com/thinkexinc-ff642c69/8W5ZwixJ0_jSRSo9/assets/thinkex-logo-wordmark-dark.svg?fit=max\u0026auto=format\u0026n=8W5ZwixJ0_jSRSo9\u0026q=85\u0026s=5b0a8aec345994b45d6146c111125906","href":"https://thinkex.app"},"favicon":"https://mintcdn.com/thinkexinc-ff642c69/gVxI8gm24T-Hq3sW/assets/favicon.svg?fit=max\u0026auto=format\u0026n=gVxI8gm24T-Hq3sW\u0026q=85\u0026s=f145962b5659de309e479808fdd9659f","navbar":{"primary":{"type":"button","label":"Open app","href":"https://thinkex.app"}},"footer":{"socials":{"github":"https://github.com/ThinkEx-OSS/thinkex","x":"https://x.com/trythinkex","discord":"https://discord.gg/dtPnzkqCcG"}},"icons":{"library":"lucide"},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"thinkexinc-ff642c69","hasAudioNarration":false,"actualSubdomain":"thinkexinc-ff642c69","customDomains":["docs.thinkex.app"],"gitSource":{"type":"github","owner":"thinkex-oss","repo":"thinkex","deployBranch":"main","contentDirectory":"docs","isPrivate":false,"mountPath":"","label":""},"feedback":{"thumbs":true},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6a98beec331460d7046ec187","clientVersion":"0.0.4389","searchFilterCounts":[{"language":"default","tag":"Configuration","count":5},{"language":"default","tag":"Product","count":3},{"language":"default","tag":"Guides","count":3},{"language":"default","tag":"Start","count":2},{"language":"default","tag":"Project","count":2}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":true,"enableContextualStarterQuestions":true,"enableAskAiSearchBar":true,"deflection":{"enabled":true,"email":"support@thinkex.app","showHelpButton":true}},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"treatment","enabled":true,"payload":{"type":"string","value":"treatment"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[],"googleFontsInlined":false},"customCss":[]}
{"page":{"pagePath":"configuration/deployments","slug":"/configuration/deployments","pageMetadata":{"title":"Deployments","description":"CI, staging, and production deployment shape.","href":"/configuration/deployments"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"CI, staging, and production deployment shape.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={code:`code`,p:`p`,pre:`pre`,span:`span`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,..._provideComponents(),...props.components},{CodeBlock,Heading,Table,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`ThinkEx deploys from Cloudflare Workers Builds. GitHub Actions only validates pull requests. Deploy, migration, and secret-management commands are operational actions and should not be run casually from a local checkout.`}),`\n`,_jsx(Heading,{level:`2`,id:`branches-and-environments`,children:`Branches and Environments`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Environment`}),_jsx(_components.th,{children:`URL`}),_jsx(_components.th,{children:`Worker`}),_jsx(_components.th,{children:`Trigger`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Production`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`https://thinkex.app`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`thinkex`})}),_jsxs(_components.td,{children:[`Push to `,_jsx(_components.code,{children:`main`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Staging`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`https://staging.thinkex.app`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`thinkex-staging`})}),_jsxs(_components.td,{children:[`Push to `,_jsx(_components.code,{children:`staging`})]})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`ci`,children:`CI`}),`\n`,_jsxs(_components.p,{children:[`The `,_jsx(_components.code,{children:`CI`}),` workflow runs on pull requests only. It installs with Vite+ and runs check, test, and a staging-shaped build:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`vp`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` run`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ciCheck`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` \u0026\u0026 `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`vp`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` run`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ciTest`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` \u0026\u0026 `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`vp`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` run`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ciBuildStaging`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`ciBuildStaging`}),` compiles with `,_jsx(_components.code,{children:`CLOUDFLARE_ENV=staging`}),` so PR CI exercises real Wrangler env flattening. PostHog build secrets are optional for that path (analytics stays off when unset); production deploy still requires the full production PostHog set, including the feedback survey id. Local `,_jsx(_components.code,{children:`vp run verify`}),` stays on the generic `,_jsx(_components.code,{children:`ciBuild`}),` (`,_jsx(_components.code,{children:`build:app`}),`) so contributors without Infisical are unaffected. When changes go through a pull request, the `,_jsx(_components.code,{children:`validate`}),` check must be green before merge.`]}),`\n`,_jsxs(_components.p,{children:[`The separate `,_jsx(_components.code,{children:`React Doctor`}),` workflow runs on pull requests and pushes to `,_jsx(_components.code,{children:`main`}),`. It scans changed React files on pull requests, posts inline diagnostics, and records the React Doctor score without folding those comments into the main Vite+ verification job.`]}),`\n`,_jsx(Heading,{level:`2`,id:`deploy`,children:`Deploy`}),`\n`,_jsx(_components.p,{children:`Two Workers Builds configurations watch this repository, one per branch. Each runs a build command, then a deploy command that applies Postgres migrations before shipping the Worker:`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Branch`}),_jsx(_components.th,{children:`Build`}),_jsx(_components.th,{children:`Deploy`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`main`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`pnpm run build:production`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`pnpm run db:migrate \u0026\u0026 pnpm run deploy:worker`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`staging`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`pnpm run build:staging`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`pnpm run db:migrate:staging \u0026\u0026 pnpm run deploy:worker:staging`})})]})]})]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`CLOUDFLARE_ENV`}),` is set per configuration in the Cloudflare dashboard, which is why `,_jsx(_components.code,{children:`deploy:worker`}),` takes no `,_jsx(_components.code,{children:`--env`}),` flag. Running it from a local checkout without that variable targets the `,_jsx(_components.code,{children:`thinkex-dev`}),` Worker, not production.`]}),`\n`,_jsxs(_components.p,{children:[`Build variables and secrets (Cloudflare API token, PostHog production set) live in the Workers Builds settings. Each deployment configuration also needs the environment’s direct PlanetScale administrative connection string as the build-time `,_jsx(_components.code,{children:`DATABASE_URL`}),`; it is used only by Drizzle Kit and is not a Worker runtime secret. The Worker itself connects with the environment’s cache-disabled `,_jsx(_components.code,{children:`HYPERDRIVE`}),` binding and a restricted runtime database role.`]}),`\n`,_jsx(Heading,{level:`2`,id:`container-images`,children:`Container Images`}),`\n`,_jsxs(_components.p,{children:[`Production and staging pin container images to immutable `,_jsx(_components.code,{children:`registry.cloudflare.com`}),` digests (`,_jsx(_components.code,{children:`wrangler.jsonc`}),`), so ordinary deploys never need Docker and Workers Builds can run without a Docker daemon. The top-level config still points at the Dockerfiles for `,_jsx(_components.code,{children:`wrangler dev`}),`.`]}),`\n`,_jsx(_components.p,{children:`The Dockerfiles change rarely, so there is no workflow for this. When one does change, rebuild and repin by hand from a machine with Docker:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`4`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`wrangler`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` containers`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` build`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ./containers/gotenberg`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --tag`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` thinkex-officepdfconverter-production:`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`\u003c`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`new-ta`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`g`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --push`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`wrangler`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` containers`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` images`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` list`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --filter`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` thinkex-officepdfconverter`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Copy the digest from the second command into the `,_jsx(_components.code,{children:`containers`}),` blocks for both `,_jsx(_components.code,{children:`staging`}),` and `,_jsx(_components.code,{children:`production`}),` in `,_jsx(_components.code,{children:`wrangler.jsonc`}),`, then push. Both environments intentionally share one image per container.`]}),`\n`,_jsx(Warning,{children:_jsx(_components.p,{children:`Remote migrations and deploy commands affect shared environments. Run them only when you are intentionally doing release work.`})}),`\n`,_jsx(Heading,{level:`2`,id:`secrets`,children:`Secrets`}),`\n`,_jsx(_components.p,{children:`Runtime and deploy secrets originate in Infisical. Build-time secrets (Cloudflare credentials, PostHog variables) are set in each Workers Builds configuration; runtime secrets declared by the Worker configuration are set on the Worker itself. GitHub only holds what PR CI needs.`}),`\n`,_jsxs(_components.p,{children:[`Direct workspace uploads additionally require bucket-scoped R2 Object Read \u0026 Write credentials in `,_jsx(_components.code,{children:`R2_ACCESS_KEY_ID`}),` and `,_jsx(_components.code,{children:`R2_SECRET_ACCESS_KEY`}),`, `,_jsx(_components.code,{children:`R2_ACCOUNT_ID`}),`, and an independent random `,_jsx(_components.code,{children:`WORKSPACE_UPLOAD_TOKEN_SECRET`}),` for completion claims. Configure browser PUT access from the checked-in policies:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`wrangler`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` r2`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` bucket`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` cors`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` set`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` thinkex-workspace-kernel-files-staging`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --file`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` config/r2/cors.staging.json`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`wrangler`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` r2`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` bucket`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` cors`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` set`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` thinkex-workspace-kernel-files`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --file`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` config/r2/cors.production.json`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`After inspecting existing lifecycle rules, add a one-day expiry for abandoned direct-upload objects in each bucket:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`wrangler`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` r2`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` bucket`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` lifecycle`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` add`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` thinkex-workspace-kernel-files-staging`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` expire-abandoned-workspace-file-uploads`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` workspace_file_uploads/`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --expire-days`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 1`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`wrangler`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` r2`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` bucket`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` lifecycle`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` add`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` thinkex-workspace-kernel-files`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` expire-abandoned-workspace-file-uploads`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` workspace_file_uploads/`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --expire-days`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 1`})]}),`\n`]})})}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`CORS `,_jsx(_components.code,{children:`set`}),` replaces the bucket’s current CORS policy. Reconcile the checked-in policy with any existing rules before applying it.`]})})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Deployments","description":"CI, staging, and production deployment shape.","href":"/configuration/deployments"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Branches and Environments","slug":"branches-and-environments","depth":2,"children":[]},{"title":"CI","slug":"ci","depth":2,"children":[]},{"title":"Deploy","slug":"deploy","depth":2,"children":[]},{"title":"Container Images","slug":"container-images","depth":2,"children":[]},{"title":"Secrets","slug":"secrets","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"thinkexinc-ff642c69","siteName":"ThinkEx","title":"Deployments - ThinkEx","contextualStarterQuestions":[{"_id":"6a7be723d20312f6f749ed41","deploymentId":"69d48a4e23f6df4814cf8a3b","questionText":"How does CI validation work?","status":"active","generatedBy":"contextual","path":"configuration/deployments","createdAt":"2026-08-12T03:23:15.212Z","updatedAt":"2026-08-12T03:23:15.212Z","__v":0},{"_id":"6a7be723d20312f6f749ed40","deploymentId":"69d48a4e23f6df4814cf8a3b","questionText":"What triggers staging deployment?","status":"active","generatedBy":"contextual","path":"configuration/deployments","createdAt":"2026-08-12T03:23:15.212Z","updatedAt":"2026-08-12T03:23:15.212Z","__v":0},{"_id":"6a7be723d20312f6f749ed3f","deploymentId":"69d48a4e23f6df4814cf8a3b","questionText":"How do I deploy to production?","status":"active","generatedBy":"contextual","path":"configuration/deployments","createdAt":"2026-08-12T03:23:15.211Z","updatedAt":"2026-08-12T03:23:15.211Z","__v":0}],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-08-12T03:23:04.278Z","originalFileLocation":"configuration/deployments.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"CI, staging, and production deployment shape.\">\u003cmeta data-mint-head name=\"application-name\" content=\"ThinkEx\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/thinkexinc-ff642c69/aEWgPK1w3PJzt4hx/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/thinkexinc-ff642c69/aEWgPK1w3PJzt4hx/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/thinkexinc-ff642c69/aEWgPK1w3PJzt4hx/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/thinkexinc-ff642c69/aEWgPK1w3PJzt4hx/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/thinkexinc-ff642c69/aEWgPK1w3PJzt4hx/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/thinkexinc-ff642c69/aEWgPK1w3PJzt4hx/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/thinkexinc-ff642c69/aEWgPK1w3PJzt4hx/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/thinkexinc-ff642c69/aEWgPK1w3PJzt4hx/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/thinkexinc-ff642c69/aEWgPK1w3PJzt4hx/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Deployments - ThinkEx\">\u003cmeta data-mint-head property=\"og:description\" content=\"CI, staging, and production deployment shape.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"ThinkEx\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.thinkex.app/configuration/deployments\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://thinkexinc-ff642c69.mintlify.site/_mintlify/api/og/v2?division=Configuration\u0026amp;title=Deployments\u0026amp;description=CI%2C+staging%2C+and+production+deployment+shape.\u0026amp;theme=c7c7e5e30713f4c921fb345c\u0026amp;signature=0a2ef4c10a88606aa9a4e12f21efe671048694775ce734d6078777a4c105fd74\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Deployments - ThinkEx\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"CI, staging, and production deployment shape.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://thinkexinc-ff642c69.mintlify.site/_mintlify/api/og/v2?division=Configuration\u0026amp;title=Deployments\u0026amp;description=CI%2C+staging%2C+and+production+deployment+shape.\u0026amp;theme=c7c7e5e30713f4c921fb345c\u0026amp;signature=0a2ef4c10a88606aa9a4e12f21efe671048694775ce734d6078777a4c105fd74\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/thinkexinc-ff642c69/aEWgPK1w3PJzt4hx/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"ThinkEx\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#5C8BD6\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.thinkex.app/configuration/deployments\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/configuration/deployments.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.thinkex.app/#organization\",\"name\":\"ThinkEx\",\"url\":\"https://docs.thinkex.app\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/thinkexinc-ff642c69/8W5ZwixJ0_jSRSo9/assets/thinkex-logo-wordmark-light.svg?fit=max\u0026auto=format\u0026n=8W5ZwixJ0_jSRSo9\u0026q=85\u0026s=fd1e0d5a90eb267d80d9e47940ce59c1\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.thinkex.app#website\",\"name\":\"ThinkEx\",\"url\":\"https://docs.thinkex.app\",\"publisher\":{\"@id\":\"https://docs.thinkex.app/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.thinkex.app/configuration/deployments#webpage\",\"url\":\"https://docs.thinkex.app/configuration/deployments\",\"name\":\"Deployments\",\"description\":\"CI, staging, and production deployment shape.\",\"dateModified\":\"2026-08-12T03:23:04.278Z\",\"isPartOf\":{\"@id\":\"https://docs.thinkex.app#website\"},\"breadcrumb\":{\"@id\":\"https://docs.thinkex.app/configuration/deployments#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.thinkex.app/configuration/deployments#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Configuration\",\"item\":\"https://docs.thinkex.app/configuration/local-development\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Deployments\",\"item\":\"https://docs.thinkex.app/configuration/deployments\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.thinkex.app/configuration/deployments#article\",\"headline\":\"Deployments\",\"name\":\"Deployments\",\"description\":\"CI, staging, and production deployment shape.\",\"url\":\"https://docs.thinkex.app/configuration/deployments\",\"mainEntityOfPage\":{\"@id\":\"https://docs.thinkex.app/configuration/deployments#webpage\"},\"dateModified\":\"2026-08-12T03:23:04.278Z\",\"publisher\":{\"@id\":\"https://docs.thinkex.app/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.thinkex.app#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"ThinkEx\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"ThinkEx\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/configuration/deployments.md","siteName":"ThinkEx","nav":{"global":null,"groups":[{"group":"Start","pages":[{"title":"ThinkEx","href":"/index"},{"title":"Quickstart","href":"/quickstart"}]},{"group":"Product","pages":[{"title":"Workspaces","href":"/concepts/workspaces"},{"title":"Workspace items","href":"/concepts/items"},{"title":"AI chat","href":"/concepts/ai-chat"}]},{"group":"Guides","pages":[{"title":"Import files","href":"/guides/import-files"},{"title":"Collaboration","href":"/guides/collaboration"},{"title":"ThinkEx MCP Server","href":"/guides/mcp"}]},{"group":"Configuration","pages":[{"title":"Local development","href":"/configuration/local-development"},{"title":"Environment","href":"/configuration/environment"},{"title":"Architecture","href":"/configuration/architecture"},{"title":"Self-hosting","description":"Current support and requirements for running your own ThinkEx deployment.","href":"/configuration/self-hosting"},{"title":"Deployments","href":"/configuration/deployments"}]},{"group":"Project","pages":[{"title":"Contributing","description":"How to work on ThinkEx safely.","href":"/project/contributing"},{"title":"Supporters","href":"/project/supporters"}]}]},"basePath":"","title":"Deployments - ThinkEx","deploymentId":"dpl_4DWa5VHHws8GyZotTfaG5njNqY1w","buildId":"dpl_4DWa5VHHws8GyZotTfaG5njNqY1w","dynamics":[],"chunks":[]}