5.2.6
Deploy
Build Vega as a static site and deploy it with Cloudflare Workers Builds, or run the EmDash server.
What the build makes
pnpm build
With Markdown, the build is a static site. Astro writes it to dist/, with the home search’s listings.json and the site search index in dist/pagefind/. There is no server code. The forms post to your form service, so they need no server either.
The build runs the setup check first. If a setting or a link is wrong, or a placeholder is left, it stops and lists the problems. See Settings.
Set your address
The feed, the sitemap, robots.txt, llms.txt, the share images and the structured data need your site’s public address. Set the SITE_URL environment variable, for example SITE_URL=https://<your-domain> pnpm build, or edit the site line in astro.config.mjs.
Until you set it, a static build’s links point at https://example.com. Nothing stops a build with no address, so check this before you launch. See Search and AI.
Tell Cloudflare what to serve
The repo has no Cloudflare config. Add a file wrangler.jsonc at the root of your repo:
{
"name": "my-site",
"compatibility_date": "2026-10-01",
"assets": { "directory": "./dist", "not_found_handling": "404-page" }
}
name must match the name of your Worker in the Cloudflare dashboard. If it does not, the build fails. not_found_handling serves the site’s own 404 page.
Connect the repo
- Push your own repo to GitHub. See Install.
- In the Cloudflare dashboard, create a Worker from your Git repository (Workers Builds).
- Set the build command to
pnpm build. - If you use
SITE_URL, add it as a build variable.
Cloudflare then builds the site and serves dist/.
EmDash
With the EmDash source, the build is a server app for Node (@astrojs/node). It keeps its data in a SQLite file (data.db) and its uploads in uploads/. It does not run on Cloudflare Workers as it ships, so the steps above do not apply.
- Load the content once with
pnpm seed:emdash. See Switch to EmDash. - Build it, with your address:
SITE_URL=https://<your-domain> CONTENT_SOURCE=emdash pnpm build. The address at build lets EmDash resize your photos. See Photos on EmDash. - Run it, with your address:
SITE_URL=https://<your-domain> pnpm start, with your own domain in place of<your-domain>.
A server with no address does not use the placeholder. It uses the address it sees for each request, which is http://localhost with the port unless security.allowedDomains in astro.config.mjs names your domain. The log has one line asking for SITE_URL.
A production server runs no setup check. So check it first with pnpm dev, then try each form. See Settings.