Skip to content

Migrate site from Hugo to Astro and add CI/CD workflows for GitHub Pages#3

Open
sudheer wants to merge 2 commits intomainfrom
migrate-blog-from-hugo-to-astro-1cwos5
Open

Migrate site from Hugo to Astro and add CI/CD workflows for GitHub Pages#3
sudheer wants to merge 2 commits intomainfrom
migrate-blog-from-hugo-to-astro-1cwos5

Conversation

@sudheer
Copy link
Owner

@sudheer sudheer commented Mar 21, 2026

Motivation

  • Replace the existing Hugo site with an Astro-based site to modernize the frontend and developer tooling.
  • Move content into an Astro-friendly structure and introduce typed content collections for safer content handling.
  • Add GitHub Actions to provide automated type/content checks, builds, and per-PR preview deployments to GitHub Pages.
  • Provide a bootstrap workflow and documentation to initialize and manage the gh-pages branch for previews and production.

Description

  • Add a complete Astro project including package.json, package-lock.json, astro.config.mjs, tsconfig.json, and src/ containing layouts, components, pages, styles, and content files.
  • Migrate legacy content from the old content/ tree into src/content/ as Markdown files and introduce src/content/config.ts with astro:content schemas for posts and micro collections.
  • Add GitHub Actions workflows: astro-ci.yml to run npm run check and npm run build on PRs and pushes, astro-preview.yml to build and deploy PR previews to gh-pages/preview/pr-<number>/ and comment the preview URL on the PR, astro-pages.yml to build and deploy production to the gh-pages root, and bootstrap-pages-branch.yml to create a bootstrap gh-pages branch if missing.
  • Remove the old hugo.yml workflow and add MIGRATION_NOTES.md documenting the Hugo → Astro migration, Pages settings, and the preview/production deployment behavior.

Testing

  • CI is configured to run npm run check and npm run build on pull requests and pushes via .github/workflows/astro-ci.yml.
  • The PR preview workflow astro-preview.yml is set to build the site and deploy previews under gh-pages/preview/pr-<number>/ and post the preview URL as a PR comment when reachable.
  • The production workflow astro-pages.yml builds and deploys dist/ to the gh-pages branch while preserving preview folders using clean-exclude: preview.
  • The workflows were added in this change; no automated workflow runs are included in this patchset (workflows will run once the branch is pushed and PR workflows are triggered).

Codex Task

- Replace the existing Hugo site with an Astro-based site to modernize the frontend and developer tooling.
- Move content into an Astro-friendly structure and introduce typed content collections for safer content handling.
- Add GitHub Actions to provide automated type/content checks, builds, and per-PR preview deployments to GitHub Pages.
- Provide a bootstrap workflow and documentation to initialize and manage the `gh-pages` branch for previews and production.

- Add a complete Astro project including `package.json`, `package-lock.json`, `astro.config.mjs`, `tsconfig.json`, and `src/` containing layouts, components, pages, styles, and content files.
- Migrate legacy content from the old `content/` tree into `src/content/` as Markdown files and introduce `src/content/config.ts` with `astro:content` schemas for `posts` and `micro` collections.
- Add GitHub Actions workflows: `astro-ci.yml` to run `npm run check` and `npm run build` on PRs and pushes, `astro-preview.yml` to build and deploy PR previews to `gh-pages/preview/pr-<number>/` and comment the preview URL on the PR, `astro-pages.yml` to build and deploy production to the `gh-pages` root, and `bootstrap-pages-branch.yml` to create a bootstrap `gh-pages` branch if missing.
- Remove the old `hugo.yml` workflow and add `MIGRATION_NOTES.md` documenting the Hugo → Astro migration, Pages settings, and the preview/production deployment behavior.

- CI is configured to run `npm run check` and `npm run build` on pull requests and pushes via `.github/workflows/astro-ci.yml`.
- The PR preview workflow `astro-preview.yml` is set to build the site and deploy previews under `gh-pages/preview/pr-<number>/` and post the preview URL as a PR comment when reachable.
- The production workflow `astro-pages.yml` builds and deploys `dist/` to the `gh-pages` branch while preserving preview folders using `clean-exclude: preview`.
- The workflows were added in this change; no automated workflow runs are included in this patchset (workflows will run once the branch is pushed and PR workflows are triggered).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant