{"name":"deploy-site-to-cloudflare","description":"Deploys a static site, single-page app or full-stack app to Cloudflare Workers with Wrangler - log in, pick static assets or a Worker, set secrets, preview, then ship - and adds storage such as KV, D1 or R2 only when needed. Use when the user wants to host on Cloudflare, deploy with wrangler, or move a site to Cloudflare Workers or Pages.","category":"deployment","tags":["cloudflare","hosting","dns"],"models":["any"],"proven":false,"passing_families":0,"model_testing":"Not yet model-tested; testing Jan 2027","url":"https://theskillvault.ai/skills/deploy-site-to-cloudflare","api_url":"https://theskillvault.ai/api/skills/deploy-site-to-cloudflare","raw_url":"https://theskillvault.ai/api/skills/deploy-site-to-cloudflare/raw","body":"# Deploy a site to Cloudflare\n\nShip a site to Cloudflare's network with the Wrangler command-line tool. Most sites need only static assets; add a Worker when you need server code.\n\n## When to use\n- You want fast, cheap hosting on Cloudflare for a static site or app.\n- You were told to \"run wrangler deploy\" and want to do it safely.\n- You are moving off another host and want a preview first.\n\n## When not to use\n- Your app is Next.js and you want zero config. Use deploy-nextjs-to-vercel, or the Cloudflare adapter for your framework.\n\n## Steps\n1. Build the site locally (`npm run build`) and note the output folder, such as `dist`.\n2. Run `npx wrangler login`, then `npx wrangler whoami` to confirm the account.\n3. Add a `wrangler.toml` (or `wrangler.jsonc`) with a `name`, a `compatibility_date` and an `[assets]` block pointing at the build folder.\n4. If you have server code, add `main = \"src/worker.ts\"`. Keep API routes there.\n5. Store secrets with `npx wrangler secret put NAME`. Put plain config in `[vars]`.\n6. Test locally with `npx wrangler dev`.\n7. Run `npx wrangler deploy --dry-run` to check the bundle without shipping.\n8. Ask before the real deploy, then run `npx wrangler deploy` and open the `*.workers.dev` URL it prints.\n9. Add your domain under the Worker's settings when the preview looks right.\n\n| Need | Cloudflare piece |\n| --- | --- |\n| Key-value cache or settings | KV |\n| SQL database | D1 |\n| File and image storage | R2 |\n| Background jobs | Queues |\n\n## Gotchas\n- Never put API keys in `[vars]` or in git. They are visible. Use `wrangler secret`.\n- An old `compatibility_date` can disable newer runtime features. Use a recent date for new projects.\n- Single-page apps need `not_found_handling = \"single-page-application\"` under `[assets]` so deep links work.\n- Workers do not run every Node module. Add `nodejs_compat` to compatibility flags when a library needs Node APIs.\n- In CI, use a scoped API token as a secret, not your personal login.\n\n## Portability\nWorks with Astro, SvelteKit, Vite, Remix and plain HTML. If you use a framework with its own Cloudflare adapter, follow its build command and keep the same wrangler steps.\n\n## Example prompt\n\"Deploy my Vite site to Cloudflare. Show me a dry run first and keep my API key secret.\"\n\n## Done when\n- `wrangler deploy --dry-run` passes with no errors.\n- The live URL loads, deep links work, and secrets are set with `wrangler secret`, not in files.\n- The custom domain (if any) shows the new site over HTTPS.\n\n---\nModified from \"cloudflare-deploy\" in openai/skills (Apache-2.0). Changes by TheSkillVault are listed in the metadata above. See LICENSE.txt.","files":["LICENSE.txt"],"license":"Apache-2.0","license_name":"Apache License 2.0","license_url":"https://www.apache.org/licenses/LICENSE-2.0","attribution":"Based on work by OpenAI (openai/skills, cloudflare-deploy) (Copyright (c) OpenAI (openai/skills, cloudflare-deploy); Apache License 2.0 text in LICENSE.txt, Apache License 2.0), https://github.com/openai/skills/tree/49f948faa9258a0c61caceaf225e179651397431/skills/.curated/cloudflare-deploy; adapted by TheSkillVault, https://theskillvault.ai","install":{"claude_code":"curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/deploy-site-to-cloudflare/raw' -o ~/'.claude/skills/deploy-site-to-cloudflare/SKILL.md' && curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/deploy-site-to-cloudflare/files/LICENSE.txt' -o ~/'.claude/skills/deploy-site-to-cloudflare/LICENSE.txt'","cursor":"curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/deploy-site-to-cloudflare/raw' -o '.cursor/skills/deploy-site-to-cloudflare/SKILL.md' && curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/deploy-site-to-cloudflare/files/LICENSE.txt' -o '.cursor/skills/deploy-site-to-cloudflare/LICENSE.txt'","agents":"curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/deploy-site-to-cloudflare/raw' -o '.agents/skills/deploy-site-to-cloudflare/SKILL.md' && curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/deploy-site-to-cloudflare/files/LICENSE.txt' -o '.agents/skills/deploy-site-to-cloudflare/LICENSE.txt'","mcp_url":"https://theskillvault.ai/mcp","cursor_mcp_deeplink":"cursor://anysphere.cursor-deeplink/mcp/install?name=theskillvault&config=eyJ1cmwiOiJodHRwczovL3RoZXNraWxsdmF1bHQuYWkvbWNwIn0%3D","mcp_config":{"mcpServers":{"theskillvault":{"url":"https://theskillvault.ai/mcp"}}}},"bundles":[],"tested_on":[{"family":"chatgpt","name":"ChatGPT","outcome":null,"date":null,"source":null,"counts":false,"stale":false},{"family":"claude","name":"Claude","outcome":null,"date":null,"source":null,"counts":false,"stale":false},{"family":"gemini","name":"Gemini","outcome":null,"date":null,"source":null,"counts":false,"stale":false},{"family":"grok","name":"Grok","outcome":null,"date":null,"source":null,"counts":false,"stale":false},{"family":"llama","name":"Llama","outcome":null,"date":null,"source":null,"counts":false,"stale":false},{"family":"deepseek","name":"DeepSeek","outcome":null,"date":null,"source":null,"counts":false,"stale":false},{"family":"mistral","name":"Mistral","outcome":null,"date":null,"source":null,"counts":false,"stale":false},{"family":"qwen","name":"Qwen","outcome":null,"date":null,"source":null,"counts":false,"stale":false},{"family":"kimi","name":"Kimi K","outcome":null,"date":null,"source":null,"counts":false,"stale":false}],"proven_rule":{"threshold":5,"window_days":365,"computed_at":"2026-11-02T03:20:33.817Z"}}