ci: add GitHub Actions deploy workflow for GitHub Pages#199
ci: add GitHub Actions deploy workflow for GitHub Pages#199
Conversation
Switch production publishing from the legacy 'Deploy from branch' method (Jekyll 3.10 sandbox) to a GitHub Actions workflow so the Gemfile's Jekyll 4.4 version is used in production. - Add .github/workflows/deploy.yml using the standard Pages pattern: actions/configure-pages → jekyll build → upload-pages-artifact → deploy-pages - Trigger on push to main and workflow_dispatch - Mirror ruby/setup-ruby config from existing build.yml (Ruby 3.2, bundler-cache) - Set JEKYLL_ENV=production and pass base_path from configure-pages After merging, go to Settings → Pages → Source and change from 'Deploy from a branch' to 'GitHub Actions' to activate this workflow. Closes #198
✅ Deploy Preview for grand-swan-ca5201 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Pull request overview
This PR adds a dedicated GitHub Actions deployment workflow for the QuantEcon Jekyll site so production publishing uses the repository’s configured Jekyll 4.4 toolchain instead of the legacy GitHub Pages branch build.
Changes:
- Adds a new Pages deployment workflow that builds the site with Ruby 3.2 and Bundler cache.
- Uses
actions/configure-pages, uploads the generated_siteartifact, and deploys it viaactions/deploy-pages. - Keeps the existing PR preview workflow separate from production deployment.
- Scope pages:write and id-token:write to the deploy job only; top-level permissions reduced to contents:read so the build job (which runs repo code and third-party actions) cannot use deployment credentials even if compromised. - Add if: github.ref == 'refs/heads/main' guard to the deploy job so a manual workflow_dispatch triggered from a non-main branch builds but never publishes to production.
Copilot feedback addressedTwo commits pushed to address the two Copilot security notes:
Why this migration is worth doingThe core problemThe legacy "Deploy from a branch" Pages setup runs builds inside GitHub's gem sandbox, which is pinned to Jekyll 3.10 and LibSass (via What Jekyll 4.x unlocks
The Gemfile controlWith the legacy setup, the ReproducibilityLocal builds, Netlify preview builds, and production builds all use identical Ruby + Jekyll + gem versions. The "it works locally but fails in production" class of bug goes away. SummaryThis is a small workflow file that removes a large hidden constraint on the tooling we can use. The immediate unblock is Dart Sass |
Summary
Switches production publishing from the legacy "Deploy from a branch" method (which pins to the GitHub Pages gem sandbox / Jekyll 3.10) to a proper GitHub Actions workflow so the Gemfile's Jekyll 4.4 is used in production.
What changed
Added
.github/workflows/deploy.ymlusing the standard GitHub Pages Actions pattern:ruby/setup-ruby— same Ruby 3.2 +bundler-cache: trueconfig as the existingbuild.ymlactions/configure-pages— emits the correctbase_pathfor the site URLbundle exec jekyll buildwithJEKYLL_ENV=productionactions/upload-pages-artifact→actions/deploy-pagesTriggers on push to
mainandworkflow_dispatch. The existingbuild.yml(PR preview) is left untouched.Required manual step after merge
After this lands we can
@use/@forwardDart Sass directives inassets/main.scss(currently reverted to@importas a workaround)github-pagesgem dependency entirelyVerification checklist
quantecon.orgCNAME resolves correctlypages/still work_posts,_lectures,_team-members,_projects) build identicallysitemap.xmlandfeed.xmloutputCloses #198