Lyra Astro documentation

Deploying

Put your site online for free with Cloudflare, Netlify, Vercel or any web host.

npm run build turns the project into a folder of plain files, dist/, that any web host can serve, and builds the search index inside it. The easiest way to publish is to put your project on GitHub and connect it to a free host, which rebuilds the site every time you save a change to GitHub.

Set site in astro.config.mjs to your final address first.

Settings for every host

Setting Value
Build command npm run build
Output folder dist
Node.js version 22.12 or newer

Cloudflare

Cloudflare is free, fast worldwide, and has no bandwidth limits.

  1. Put the project in a GitHub repository. GitHub Desktop makes this point-and-click.
  2. In the Cloudflare dashboard, go to Workers & Pages → Create and import the repository.
  3. Cloudflare now creates new projects as Workers. Lyra includes a wrangler.jsonc file that tells it to serve the dist folder as a static site, so keep the suggested deploy command (npx wrangler deploy) and set the build command to npm run build.
  4. Click Deploy. When it finishes, add your domain under Settings → Domains & Routes.

Change "name" in wrangler.jsonc to your project’s name if you like. If you choose a classic Cloudflare Pages project instead, use the settings in the table above; wrangler.jsonc is then ignored.

Netlify

  1. Put the project in a GitHub repository.
  2. In Netlify, choose Add new site → Import an existing project and pick the repository.
  3. Netlify detects Astro and fills in the settings. Click Deploy.

To use Netlify Forms, see Forms and newsletter.

Vercel

  1. Put the project in a GitHub repository.
  2. In Vercel, choose Add New → Project and import it.
  3. Vercel detects Astro. Click Deploy.

Any other web host

Run npm run build and upload the contents of dist to your host’s public folder (often public_html) with FTP or the host’s file manager. Upload the pagefind folder too, or search won’t work.

Keeping events current

Whether an event is upcoming or past is worked out when the site is built. Rebuild after each event, or schedule a daily rebuild: Cloudflare, Netlify and Vercel all offer a “deploy hook” address that you can call each day from a free scheduler such as cron-job.org. Campaign countdowns don’t need this: they update in the visitor’s browser.

Check before publishing

npm run build
npm run preview

This serves the finished site at localhost:4321, exactly as it will appear online, including search.