AstroSEO.io

Deployment ยท 2026-06-04

Deploy Astro to GitHub Pages with GitHub Actions

Publish an Astro project to GitHub Pages using the official GitHub Actions workflow and project-site base paths.

Why this matters

GitHub Pages is an easy first production target for template sites, especially when you want low-friction repo-based publishing.

Setup

Set a project-site base path in astro.config.mjs.

export default defineConfig({
  site: "https://yangjun.github.io",
  base: "/astroseo-io"
});

Implementation notes

The workflow should build dist/ and upload it as a Pages artifact. Once the site is live, validate feed and sitemap using Astro Sitemap, RSS, and Canonical URLs.

Final checklist

  • base matches the repo name
  • Pages source is GitHub Actions
  • Workflow builds and deploys without manual steps

Related posts