documentation menu

Astro

Astro's default static output builds to dist/ and needs no flags — this site is one.

read as markdown

Astro’s default output is static, so there is nothing to configure. npm run build writes dist/ and you deploy it.

astro
$ npm run buildbuilding client (vite)▶ dist/ 24 page(s) built in 1.83s$ one9x pages release ./dist --site mysite --deploy✓ v1 live→ https://mysite.one9x.app/

No --spa. Astro writes a real HTML file per route.

This documentation site is an Astro build deployed to Pages on every push — the same command, the same action, the same preview URLs.

Set site for correct absolute URLs

// astro.config.mjs
export default defineConfig({
  site: 'https://mysite.one9x.app',
});

Astro needs site to build canonical URLs, and it is what @astrojs/sitemap uses. Set it to your custom domain if you have linked one — sitemaps with the wrong hostname are the one mistake here that search engines act on.

If you switched on an adapter

output: 'server' or a deployment adapter produces a build that needs a runtime, not a folder of files. Remove the adapter and go back to the default static output.

output: 'hybrid'/per-route prerender is fine for the prerendered routes and not for the rest — if any route is server-rendered, the build as a whole needs a server.

Custom 404

Astro builds src/pages/404.astro to dist/404.html:

404
$ one9x pages release ./dist --site mysite --deploy --error 404:/404.html✓ v2 live · custom 404

Start from a template

Live, and deployed by the workflow in that repo on every push: astro.one9x.app.

one9x/template-astro is a minimal Astro starter with this deploy already wired up. Press Use this template on GitHub to get your own copy, or read it as a reference for a project you already have.

Set two things in the new repo under Settings → Secrets and variables → Actions and it deploys on every push:

NameValue
VariableONE9X_SITEthe site to deploy to
SecretONE9X_TOKENone9x tokens create "github actions"

Until ONE9X_SITE is set the workflow is skipped rather than failed — a fresh copy should not open with a red X.

Deploying on every push

- uses: actions/setup-node@v5
  with: { node-version: 22, cache: npm }
- run: npm ci
- run: npm run build
- uses: one9x/pages-deploy@v1
  with:
    site: mysite
    dir: dist
    error-pages: "404:/404.html"
    token: ${{ secrets.ONE9X_TOKEN }}
    deploy: ${{ github.ref == 'refs/heads/main' }}