Step 8: Deploy (Cloudflare or Vercel)
Now you'll put the site live. Pick one host: Option A is Cloudflare, Option B is Vercel.
Before you start
- Step 7 finished
- A Cloudflare account
- Your repo on GitHub or GitLab
Do it
Type each command on its own and wait for it to finish before the next one.
Option A: Cloudflare Workers
Open wrangler.jsonc and set your Worker's name:
"name": "my-site"Check the deploy locally. This does not need a login.
npx wrangler deploy --dry-runExpected output
Read 52 files from the assets directory ./site/.vitepress/dist
No bindings found.
--dry-run: exiting now.If you see an error:
assets directory does not existmeans you have not built yet. Runnpm run buildfirst.
Commit and push your project.
git add -A
git commit -m "My site"Expected output
[main 1a2b3c4] My sitegit pushExpected output
To github.com:you/my-site.git
main -> mainRequires: Cloudflare login (in the browser)
Sign in at dash.cloudflare.com. You connect the repo there, so no token goes in your project.
In Cloudflare, open Workers & Pages → Create → Import a repository. Pick your repo and use these settings:
| Setting | Value |
|---|---|
| Root directory | / |
| Build command | npm run build |
| Deploy command | npx wrangler deploy |
| Node version | from .nvmrc (or variable NODE_VERSION = 22.20.0) |
If you see an error:
name does not matchmeans the Worker name in Cloudflare differs from"name"inwrangler.jsonc. Make them the same.
Option B: Vercel
Now you'll deploy the same site to Vercel instead. The starter already has a vercel.json. It tells Vercel to run npm ci, then npm run build, and serve site/.vitepress/dist.
Requires: Vercel login
The login command opens your browser. Run it on its own and finish the sign-in. No token goes in your project.
npx vercel loginExpected output
> Success! Email authentication completeIf you see an error:
command not found: vercelis fine:npxdownloads it. If the browser does not open, copy the URL it prints.
Deploy a preview first. Answer the questions; the defaults are correct.
npx vercelExpected output
🔗 Linked to you/my-site
✅ Preview: https://my-site-abc123.vercel.appWhen the preview looks right, deploy to production.
npx vercel --prodExpected output
✅ Production: https://my-site.vercel.appIf you see an error:
Error: No Output Directory named "dist"meansvercel.jsonis missing. Copy it from the starter and run the command again.
Prefer no CLI? In the Vercel dashboard choose Add New → Project, import your repo, and keep the settings from vercel.json.
Result
Your host builds on every push to main. The site is live at my-site.<your-subdomain>.workers.dev (Cloudflare) or my-site.vercel.app (Vercel).
Checkpoint
Next step
Back: Step 7: Test 2–3 rounds