Polaris Astro documentation

Deploying

Put your site online 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. Polaris is a static site: there is no server code and no adapter. The easiest way to publish is to put your project on GitHub and connect it to a host, which rebuilds the site every time you save a change to GitHub.

Before you deploy, set site in astro.config.mjs and url in src/site.config.ts to your final address.

Settings for every host

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

The first build takes longer than later ones because every photo is resized. With the placeholder images it takes about a minute.

Cloudflare Workers

Cloudflare now creates new projects as Workers. Polaris includes a wrangler.jsonc file that tells Cloudflare to serve the dist folder as static assets. Unknown addresses get your 404.html page with a 404 status.

  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. Set the build command to npm run build and the deploy command to npx wrangler deploy.
  4. Click Deploy. When it finishes, add your domain under Settings → Domains & Routes.

Change "name" in wrangler.jsonc to your project’s name.

Cloudflare Pages

If you choose a classic Cloudflare Pages project instead, use the settings in the table above. wrangler.jsonc isn’t needed there.

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. Check that the build command is npm run build and the publish directory is dist, then click Deploy.

Vercel

  1. Put the project in a GitHub repository.
  2. In Vercel, choose Add New → Project and import it.
  3. Check that the build command is npm run build and the output directory is dist, then 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 departures current

Whether a departure is upcoming or past is worked out when the site is built. Rebuild after a departure date passes, 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.

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.

Then send a test enquiry with the method you chose. See Enquiries.