5.5.4
Deploy
Build Dispatch as a static site and deploy it with Cloudflare Workers Builds.
This guide is for the Markdown source, the default.
What the build makes
pnpm build
With Markdown, the build is a static site. Astro writes it to dist/, with the search index in dist/pagefind/. There is no server code. The sign-up forms post to your newsletter service, so they need no server either.
Set your address
The feed, the sitemap, robots.txt and the share images need your site’s public address for their links. Set the SITE_URL environment variable, for example https://<your-domain>, or edit the site line in astro.config.mjs. Until you set it, a static build’s links point at https://example.com, and an EmDash server’s use the address the server sees for each request, usually http://localhost. The structured data and llms.txt use it too. 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/. Build it with CONTENT_SOURCE=emdash pnpm build and run it with pnpm start. Set SITE_URL when you run it too: SITE_URL=https://<your-domain> pnpm start, with your own domain in place of <your-domain>. Without it, the links use the address the server sees for each request, which is http://localhost with the port unless security.allowedDomains in astro.config.mjs names your domain, and the log has one line asking for SITE_URL. It does not run on Cloudflare Workers as it ships, so this guide does not cover it.
Members can read locked stories only on a server build. See Content.