Skip to content

Commit 32ef666

Browse files
mmckyclaude
andauthored
Adopt quantecon/actions/publish-gh-pages for GitHub Pages deploy (#787)
* 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) <noreply@anthropic.com> * 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) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 29000a4 commit 32ef666

1 file changed

Lines changed: 9 additions & 36 deletions

File tree

.github/workflows/publish.yml

Lines changed: 9 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
runs-on: ubuntu-latest
2222
environment:
2323
name: github-pages
24-
url: ${{ steps.deployment.outputs.page_url }}
24+
url: ${{ steps.deployment.outputs['page-url'] }}
2525
steps:
2626
- name: Checkout
2727
uses: actions/checkout@v7
@@ -89,32 +89,6 @@ jobs:
8989
run: |
9090
rm -r _build/.doctrees
9191
jb build lectures --path-output ./
92-
# Create HTML archive for release assets
93-
- name: Create HTML archive
94-
shell: bash -l {0}
95-
run: |
96-
tar -czf lecture-python-intro-html-${{ github.ref_name }}.tar.gz -C _build/html .
97-
sha256sum lecture-python-intro-html-${{ github.ref_name }}.tar.gz > html-checksum.txt
98-
99-
# Create metadata manifest
100-
cat > html-manifest.json << EOF
101-
{
102-
"tag": "${{ github.ref_name }}",
103-
"commit": "${{ github.sha }}",
104-
"timestamp": "$(date -Iseconds)",
105-
"size_mb": $(du -sm _build/html | cut -f1),
106-
"file_count": $(find _build/html -type f | wc -l)
107-
}
108-
EOF
109-
- name: Upload archives to release
110-
uses: softprops/action-gh-release@v3
111-
with:
112-
files: |
113-
lecture-python-intro-html-${{ github.ref_name }}.tar.gz
114-
html-checksum.txt
115-
html-manifest.json
116-
env:
117-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
11892
- name: Deploy to Netlify
11993
uses: nwtgck/actions-netlify@v4.0
12094
with:
@@ -125,17 +99,16 @@ jobs:
12599
env:
126100
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
127101
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
128-
- name: Add CNAME for custom domain
129-
run: echo "intro.quantecon.org" > _build/html/CNAME
130-
- name: Setup Pages
131-
uses: actions/configure-pages@v6
132-
- name: Upload Pages artifact
133-
uses: actions/upload-pages-artifact@v5
134-
with:
135-
path: _build/html/
102+
# Deploy to GitHub Pages + publish release assets (html archive, checksum, manifest)
136103
- name: Deploy to GitHub Pages
137104
id: deployment
138-
uses: actions/deploy-pages@v5
105+
uses: quantecon/actions/publish-gh-pages@v0.8.0
106+
with:
107+
build-dir: _build/html
108+
cname: intro.quantecon.org
109+
create-release-assets: 'true'
110+
asset-name: 'lecture-python-intro-html'
111+
github-token: ${{ secrets.GITHUB_TOKEN }}
139112
- name: Upload "_build" folder (cache)
140113
uses: actions/upload-artifact@v7
141114
with:

0 commit comments

Comments
 (0)