Deploy Prod
Use this skill for a production @convex-dev/static-hosting deploy in the current repo.
Source of truth:
- Component repo:
https://github.com/get-convex/static-hosting - Component docs:
https://www.convex.dev/components/static-hosting - Custom domains:
https://docs.convex.dev/production/custom-domains
Portable Assumptions
- The current repo is a Convex app that uses
@convex-dev/static-hosting. - Prefer project scripts in
package.jsonwhen present. - The common static hosting component name is
staticHosting, but do not hard-code it if the repo defines another name. - Discover the component name from
convex/convex.config.tswhen needed by looking forapp.use(staticHosting, { name: "..." }). - If no component name is configured, use
staticHosting.
Required Rules
- Prefer the repo's full production deploy script when one exists, commonly
npm run deploy. - Use static-only production upload only when backend functions, schema, auth routes, and Convex components are already deployed.
- Do not run
npm run buildseparately before static upload. Static-hosting's--buildflag injects the correctVITE_CONVEX_URL. - Do not assume a specific production URL. Read the public site URL and Convex cloud URL from command output.
- Keep production as the canonical target in SEO, Open Graph, Twitter card, sitemap, robots, GitHub Auth callback URLs,
SITE_URL, andCONVEX_SITE_URL.
/deployprod Workflow
Run quick checks unless the user explicitly says to skip them. Use the scripts that exist in the current repo:
npm run typecheck npm run lintInspect available deploy scripts:
npm runPrefer the repo's full production deploy script:
npm run deployIf no full deploy script exists, deploy backend first, then upload production static hosting:
npx convex deploy --yes npx @convex-dev/static-hosting upload --build -c staticHosting --prodReplace
staticHostingwith the configured component name if different.If a static-only production script exists and backend is already deployed, this is acceptable:
npm run deploy:static:prodConfirm deploy output includes:
Deploying to production environment Your app is now available at: <production convex site URL>Smoke check the production page using the URL printed by deploy output:
curl -L -s <production convex site URL> | rg '/assets/index-|VITE_CONVEX_URL|<production deployment slug>'Also check that the known dev deployment slug is not present if the repo has one documented.
Troubleshooting
If production static upload fails with
Could not find function for 'staticHosting:generateUploadUrls', deploy backend first:npx convex deploy --yesThen rerun the static-hosting production upload.
If the shell cannot reach Convex because of sandboxed network restrictions, rerun the same command with the required network approval.
When To Update Project Docs
Update docs only if deploy behavior changes:
README.mdchangelog.mdtask.mdfiles.md
If the deploy behavior change is non-trivial, create a PRD in prds/.