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.
- Put the project in a GitHub repository. GitHub Desktop makes this point-and-click.
- In the Cloudflare dashboard, go to Workers & Pages → Create and import the repository.
- Cloudflare now creates new projects as Workers. Lyra includes a
wrangler.jsoncfile that tells it to serve thedistfolder as a static site, so keep the suggested deploy command (npx wrangler deploy) and set the build command tonpm run build. - 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
- Put the project in a GitHub repository.
- In Netlify, choose Add new site → Import an existing project and pick the repository.
- Netlify detects Astro and fills in the settings. Click Deploy.
To use Netlify Forms, see Forms and newsletter.
Vercel
- Put the project in a GitHub repository.
- In Vercel, choose Add New → Project and import it.
- 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.