From 81df27114a92642aacb23ede77a6bede8c9dec08 Mon Sep 17 00:00:00 2001 From: Matt McKay Date: Wed, 8 Jul 2026 15:08:47 +1000 Subject: [PATCH 1/2] INFR: Migrate GitHub Pages deploy to artifact-based workflow Replace the peaceiris/actions-gh-pages deploy with native, artifact-based GitHub Pages deployment via quantecon/actions/publish-gh-pages@v0.6.0, matching the rest of the QuantEcon lecture family. Adds the required Pages permissions, concurrency group, and github-pages environment. This removes the gh-pages branch dependency so the branch can be deleted, keeping the repo small. The build, download-notebooks, and .notebooks sync steps are unchanged. Part of the rollout tracked in QuantEcon/meta#282. Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/workflows/publish.yml | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 686c2b56..3f394e5a 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -3,10 +3,25 @@ on: push: tags: - 'publish*' + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: write # write: upload release assets (html archive, checksum, manifest) + pages: write + id-token: write # required for OIDC-based Pages deployment + +# Allow only one concurrent deployment; don't cancel an in-flight deploy +concurrency: + group: "pages" + cancel-in-progress: false + jobs: publish: if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') runs-on: ubuntu-latest + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page-url }} steps: - name: Checkout uses: actions/checkout@v4 @@ -65,12 +80,15 @@ jobs: with: name: execution-reports path: _build/html/reports - - name: Deploy website to gh-pages - uses: peaceiris/actions-gh-pages@v4 + - name: Deploy to GitHub Pages + id: deployment + uses: quantecon/actions/publish-gh-pages@v0.6.0 with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: _build/html/ + build-dir: _build/html cname: datascience.quantecon.org + create-release-assets: 'true' + asset-name: 'lecture-datascience-html' + github-token: ${{ secrets.GITHUB_TOKEN }} - name: Upload "_build" folder (cache) uses: actions/upload-artifact@v4 with: From b4330db875d0ec78016e8120365b9d2f9c1651b5 Mon Sep 17 00:00:00 2001 From: Matt McKay Date: Wed, 8 Jul 2026 15:16:09 +1000 Subject: [PATCH 2/2] publish: use bracket notation for the hyphenated page-url output `steps.deployment.outputs.page-url` is parsed as subtraction in GitHub Actions expressions (the hyphen), so environment.url wouldn't evaluate. Use index syntax `outputs['page-url']`. Addresses Copilot review feedback. Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 3f394e5a..f87e773f 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -21,7 +21,7 @@ jobs: runs-on: ubuntu-latest environment: name: github-pages - url: ${{ steps.deployment.outputs.page-url }} + url: ${{ steps.deployment.outputs['page-url'] }} steps: - name: Checkout uses: actions/checkout@v4