Skip to content
Built with

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:

jsonc
"name": "my-site"

Check the deploy locally. This does not need a login.

bash
npx wrangler deploy --dry-run

Expected output

text
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 exist means you have not built yet. Run npm run build first.

Commit and push your project.

bash
git add -A
git commit -m "My site"

Expected output

text
[main 1a2b3c4] My site
bash
git push

Expected output

text
To github.com:you/my-site.git
   main -> main

Requires: 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:

SettingValue
Root directory/
Build commandnpm run build
Deploy commandnpx wrangler deploy
Node versionfrom .nvmrc (or variable NODE_VERSION = 22.20.0)

If you see an error: name does not match means the Worker name in Cloudflare differs from "name" in wrangler.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.

bash
npx vercel login

Expected output

text
> Success! Email authentication complete

If you see an error: command not found: vercel is fine: npx downloads it. If the browser does not open, copy the URL it prints.

Deploy a preview first. Answer the questions; the defaults are correct.

bash
npx vercel

Expected output

text
🔗  Linked to you/my-site
✅  Preview: https://my-site-abc123.vercel.app

When the preview looks right, deploy to production.

bash
npx vercel --prod

Expected output

text
✅  Production: https://my-site.vercel.app

If you see an error: Error: No Output Directory named "dist" means vercel.json is 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 ​

Step 9: Custom domain

Back: Step 7: Test 2–3 rounds

implemented.stream AI