Migrate site from Hugo to Astro and add CI/CD workflows for GitHub Pages#3
Open
Migrate site from Hugo to Astro and add CI/CD workflows for GitHub Pages#3
Conversation
- 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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
gh-pagesbranch for previews and production.Description
package.json,package-lock.json,astro.config.mjs,tsconfig.json, andsrc/containing layouts, components, pages, styles, and content files.content/tree intosrc/content/as Markdown files and introducesrc/content/config.tswithastro:contentschemas forpostsandmicrocollections.astro-ci.ymlto runnpm run checkandnpm run buildon PRs and pushes,astro-preview.ymlto build and deploy PR previews togh-pages/preview/pr-<number>/and comment the preview URL on the PR,astro-pages.ymlto build and deploy production to thegh-pagesroot, andbootstrap-pages-branch.ymlto create a bootstrapgh-pagesbranch if missing.hugo.ymlworkflow and addMIGRATION_NOTES.mddocumenting the Hugo → Astro migration, Pages settings, and the preview/production deployment behavior.Testing
npm run checkandnpm run buildon pull requests and pushes via.github/workflows/astro-ci.yml.astro-preview.ymlis set to build the site and deploy previews undergh-pages/preview/pr-<number>/and post the preview URL as a PR comment when reachable.astro-pages.ymlbuilds and deploysdist/to thegh-pagesbranch while preserving preview folders usingclean-exclude: preview.Codex Task