Altair docs
Deploying
Publish Altair on Cloudflare Pages, Netlify, Vercel or GitHub Pages, or upload it to any web host.
npm run build turns the project into a folder of plain files, dist/, that any static host can serve. The easiest way to publish is to put the project in a Git repository and connect it to a host, which then rebuilds the site every time you push a change.
Whichever host you choose, set site in astro.config.mjs to the final address first.
Settings for every host
| Setting | Value |
|---|---|
| Build command | npm run build |
| Output directory | dist |
| Node.js version | 22 or newer (the project includes a .node-version file) |
Cloudflare Pages
- Push the project to a GitHub or GitLab repository.
- In the Cloudflare dashboard, go to Workers & Pages → Create → Pages → Connect to Git and choose the repository.
- Pick the Astro framework preset, or enter the settings above.
- Click Save and Deploy. Add your domain under Custom domains once the first build finishes.
Netlify
- Push the project to a Git 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.
Vercel
- Push the project to a Git repository.
- In Vercel, choose Add New → Project and import the repository.
- Vercel detects Astro. Click Deploy.
GitHub Pages
- Push the project to a GitHub repository.
- Create
.github/workflows/deploy.ymlwith the official Astro action:
name: Deploy to GitHub Pages
on:
push:
branches: [main]
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: withastro/action@v3
deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@v4
- In the repository settings, under Pages, set the source to GitHub Actions.
If the site will live at https://username.github.io/repository/ rather than on its own domain, also set base: '/repository' in astro.config.mjs. See Astro’s GitHub Pages guide for details.
Any other web host
Run npm run build and upload the contents of the dist folder to your host’s public folder (often public_html) with FTP or the host’s file manager.
Check before you publish
npm run build
npm run preview
npm run preview serves the finished site at localhost:4321, exactly as your host will.