Blog GitHub Pages Migration Design

Context

The current repository at /Users/ssunxie/code/my-blog is a Jekyll blog based on the Minimal Mistakes theme. It was previously intended for deployment to a self-managed server behind Cloudflare using the custom domain blog.sunxie.me.

The desired destination is GitHub Pages using the existing repository https://github.com/xiesunsun/xiesunsun.github.io, with the blog published only at https://blog.sunxie.me.

Additional observed context:

Goals

Non-Goals

Decision Summary

Repository strategy

Use xiesunsun/xiesunsun.github.io as the canonical repository for the blog and directly replace its existing Astro site contents. Before replacement, preserve the previous contents in a backup branch so rollback remains possible.

This approach is preferred because:

Build and deployment strategy

Deploy the Jekyll site using GitHub Actions rather than relying on GitHub Pages’ built-in Jekyll builder.

This is preferred because:

Custom domain strategy

Bind GitHub Pages only to blog.sunxie.me.

This is preferred because:

Target State

After migration:

Implementation Design

Local repository changes

The migration implementation should make the minimum necessary source changes:

Remote repository changes

Before replacing the contents of xiesunsun/xiesunsun.github.io:

GitHub Pages changes

In the repository settings or through the GitHub API:

Cloudflare DNS changes

After the GitHub Pages custom domain is updated:

Cutover Sequence

Use this order to minimize risk:

  1. Confirm the repository builds successfully locally.
  2. Prepare and commit migration changes.
  3. Back up the current remote main branch.
  4. Push the Jekyll site into xiesunsun.github.io.
  5. Update GitHub Pages custom domain to blog.sunxie.me.
  6. Wait for GitHub Pages to recognize the domain and begin certificate provisioning.
  7. Update Cloudflare DNS for blog.sunxie.me to CNAME xiesunsun.github.io.
  8. Verify HTTPS access, content correctness, and asset loading on https://blog.sunxie.me.
  9. Decommission the old server-based blog deployment once the new site is confirmed stable.

Validation

The migration is successful when all of the following are true:

Rollback

If the migration fails before DNS cutover:

If the migration fails after DNS cutover:

Risks