ermaozi builds a static site by default. The build command is npm run build and the publish directory is dist; pnpm and Yarn use the same script name.
Generate deployment configuration
Run the initializer and choose a platform under “Deployment”:
npm create astro-theme-ermaozi@beta
The initializer writes the smallest configuration for the package manager that invoked it:
| Choice | Generated files | Result |
|---|---|---|
| GitHub Pages | .github/workflows/deploy.yml |
GitHub Actions builds and publishes pushes to main |
| GitLab Pages | .gitlab-ci.yml |
The default-branch pipeline publishes dist |
| Netlify | netlify.toml |
A repository import reads the build command and output directory |
| Vercel | vercel.json |
A repository import deploys the Astro static site |
| Firebase Hosting | firebase.json, .firebaserc |
Run firebase deploy after a local build |
| Custom | No provider file | Publish dist to any static host |
No access tokens are written to these files. The GitHub Pages workflow uses OIDC permissions; other providers use their own repository authorization.
Origin and base path
Check site.config.mjs before publishing:
origin: 'https://blog.example.com',
base: '/',
originis the production origin, including the protocol and excluding a path. It is used for canonical URLs, the sitemap, and social cards.baseis the deployment subpath. A custom domain normally uses/; use/project/forhttps://example.com/project/.- CI can override these values with
SITE_ORIGINandBASE_PATH. The generated GitHub Pages and GitLab Pages configurations already derive the default Pages URL.
Internal links, images, search, Markdown source files, the sitemap, and SEO URLs all use the same base path.
GitHub Pages
- Push the repository to GitHub with
mainas the default branch. - Under Settings → Pages → Build and deployment, set Source to GitHub Actions.
- Push a commit or manually run the
Deploy to GitHub Pagesworkflow.
The workflow distinguishes user sites from project sites. For a custom domain, change SITE_ORIGIN in the workflow to the real origin and set BASE_PATH to /.
GitLab Pages
Push the repository to GitLab. The default-branch pipeline reads CI_PAGES_URL, builds the site, and publishes it with pages.publish: dist. Find the resulting URL under Deploy → Pages.
Netlify and Vercel
Import the repository in the provider dashboard. The generated configuration publishes dist; a static site does not need an Astro server adapter. Update origin when attaching a custom domain.
Firebase Hosting
Install and sign in to the Firebase CLI, then build and deploy:
npm install --global firebase-tools
firebase login
npm run build
firebase deploy
The initializer writes the Firebase project ID to .firebaserc. Update projects.default if the project changes.
Other static hosts
Use these generic settings:
Build command: npm run build
Publish directory: dist
Node.js: 22.12 or newer
Run npm run build && npm run preview for a local production check. preview is an acceptance server, not a production server.
Copyright
Copyright Ownership:
This article link:https://astro.ermao.net/en/docs/guide/deployment/
License under:Attribution 4.0 International (CC-BY-4.0)