Skip to content

Publishing Workflow Upgrade - Phase 2: gh-pages History Cleanup #261

Open

Description

@mmcky

Overview

This issue tracks the implementation of Phase 2 publishing workflow upgrades across QuantEcon lecture repositories. The upgrade performs a one-time cleanup of gh-pages branch history to dramatically reduce repository sizes.

Prerequisite: Phase 1 (HTML Archive to Release Assets) is complete - see #253

Objective

Remove accumulated deployment commits from gh-pages branches to reduce repository sizes by ~96%.

Expected Results

Metric Before After Improvement
Repository size ~4 GB ~100 MB 96% reduction
Fresh clone time 5-10 min ~30 sec 90% faster
gh-pages commits 100-200+ 1 99% fewer
Bandwidth per clone ~4 GB ~100 MB 97% less

Cleanup Procedure (Per Repository)

1. Create Backup Branch

git fetch origin gh-pages
git branch gh-pages-backup origin/gh-pages

2. Create Fresh Orphan Branch

git checkout gh-pages
git checkout --orphan gh-pages-new
git add -A
git commit -m "Fresh gh-pages deployment (history cleanup to reduce repo size)"

3. Replace Old gh-pages

git branch -D gh-pages
git branch -m gh-pages
git push origin gh-pages --force

4. Verify

# Should show 1 commit
git rev-list --count origin/gh-pages

# Verify website still works
# Visit the site URL

Implementation Status

Active Lecture Repositories

Repository Site URL Status Notes
lecture-python.myst python.quantecon.org ⏳ Pending
lecture-python-programming.myst python-programming.quantecon.org ⏳ Pending
lecture-python-advanced.myst python-advanced.quantecon.org ⏳ Pending
lecture-python-intro intro.quantecon.org ⏳ Pending
lecture-jax jax.quantecon.org ⏳ Pending
lecture-intro.zh-cn intro-zh-cn.quantecon.org ⏳ Pending
lecture-python-programming.fa - ⏳ Pending
lecture-datascience.myst datascience.quantecon.org ⏳ Pending
lecture-julia.myst julia.quantecon.org ⏳ Pending
lecture-python.zh-cn - ⏳ Pending

Legacy Repositories (Skipped)

The following repositories are scheduled for archival and will not receive this upgrade:

  • lecture-dle
  • lecture-dps
  • lecture-dynamics
  • lecture-econometrics-machine-learning
  • lecture-eqm
  • lecture-stats
  • lecture-tools-techniques

Rollback Procedure

If issues occur after cleanup:

git push origin gh-pages-backup:gh-pages --force

Related

  • Phase 1 Issue: #253 (Complete)
  • Original Implementation Plan: lecture-python.myst#661
  • Phase 3: Enable force_orphan: true for future deployments (prevents history re-accumulation)

Next Steps

  • Perform cleanup on each repository
  • Verify websites are still accessible after each cleanup
  • Delete backup branches after 1-2 weeks of verification
  • Proceed to Phase 3 (enable force_orphan)

Activity

  1. mmcky commented on Nov 26, 2025

    @mmcky
    ContributorAuthor

    Blocked: Waiting on action-backups

    Phase 2 is currently blocked pending the rollout of QuantEcon/action-backups to create full repository backups before performing the destructive gh-pages history cleanup.

    This provides an additional safety layer beyond the gh-pages-backup branches and Phase 1 HTML release archives.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions