From a30d014371b0d6eef09c58786cb9d1d2b29c29d1 Mon Sep 17 00:00:00 2001 From: Matt McKay Date: Wed, 8 Jul 2026 16:27:02 +1000 Subject: [PATCH 1/2] Adopt quantecon/actions/publish-gh-pages for GitHub Pages deploy Replaces the hand-rolled Pages deploy (configure-pages + upload-pages-artifact + deploy-pages) and inline release-asset packaging (tar/sha256/manifest -> softprops/action-gh-release) with a single quantecon/actions/publish-gh-pages@v0.8.0 step, matching the rest of the lecture family. Deploy-step only: the build, notebook sync, PDF/notebook and Netlify steps are unchanged. Part of QuantEcon/lectures#11. Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/workflows/publish.yml | 45 +++++++---------------------------- 1 file changed, 9 insertions(+), 36 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 2d2bb00c..e5579805 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -20,7 +20,7 @@ jobs: runs-on: "runs-on=${{ github.run_id }}/family=g4dn.2xlarge/image=quantecon_ubuntu2404/volume=80gb" environment: name: github-pages - url: ${{ steps.deployment.outputs.page_url }} + url: ${{ steps.deployment.outputs.page-url }} steps: - name: Checkout uses: actions/checkout@v7 @@ -101,43 +101,16 @@ jobs: shell: bash -l {0} run: | jb build lectures --path-output ./ -n -W --keep-going - # Create HTML archive for release assets - - name: Create HTML archive - shell: bash -l {0} - run: | - tar -czf lecture-python-programming-html-${{ github.ref_name }}.tar.gz -C _build/html . - sha256sum lecture-python-programming-html-${{ github.ref_name }}.tar.gz > html-checksum.txt - - # Create metadata manifest - cat > html-manifest.json << EOF - { - "tag": "${{ github.ref_name }}", - "commit": "${{ github.sha }}", - "timestamp": "$(date -Iseconds)", - "size_mb": $(du -sm _build/html | cut -f1), - "file_count": $(find _build/html -type f | wc -l) - } - EOF - - name: Upload archives to release - uses: softprops/action-gh-release@v3 - with: - files: | - lecture-python-programming-html-${{ github.ref_name }}.tar.gz - html-checksum.txt - html-manifest.json - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Add CNAME for custom domain - run: echo "python-programming.quantecon.org" > _build/html/CNAME - - name: Setup Pages - uses: actions/configure-pages@v6 - - name: Upload Pages artifact - uses: actions/upload-pages-artifact@v5 - with: - path: _build/html/ + # Deploy to GitHub Pages + publish release assets (html archive, checksum, manifest) - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@v5 + uses: quantecon/actions/publish-gh-pages@v0.8.0 + with: + build-dir: _build/html + cname: python-programming.quantecon.org + create-release-assets: 'true' + asset-name: 'lecture-python-programming-html' + github-token: ${{ secrets.GITHUB_TOKEN }} - name: Prepare lecture-python-programming.notebooks sync shell: bash -l {0} run: | From 455f3a993c6efba9761a494f085f6bd7f0731ac7 Mon Sep 17 00:00:00 2001 From: Matt McKay Date: Wed, 8 Jul 2026 16:36:39 +1000 Subject: [PATCH 2/2] Use bracket notation for the page-url output reference steps.deployment.outputs['page-url'] is the robust form for a hyphenated output key; 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 e5579805..4d0e57a0 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -20,7 +20,7 @@ jobs: runs-on: "runs-on=${{ github.run_id }}/family=g4dn.2xlarge/image=quantecon_ubuntu2404/volume=80gb" environment: name: github-pages - url: ${{ steps.deployment.outputs.page-url }} + url: ${{ steps.deployment.outputs['page-url'] }} steps: - name: Checkout uses: actions/checkout@v7