Skip to content

Commit fc22b5b

Browse files
mmckyclaude
andcommitted
Add Netlify PR previews (ci.yml) for reviewer-facing rendered builds
Uses quantecon/actions/preview-netlify@v0.8.0 (the lecture-python.myst pattern), HTML only, on ubuntu-latest. The action posts a PR comment with the preview URL and the changed lectures, so translation review can happen on rendered French pages rather than MyST diffs. Requires two secrets not yet available to this repo: the org-level NETLIFY_AUTH_TOKEN extended to include this repo, and a repo-level NETLIFY_SITE_ID for a new Netlify site. Until they exist the preview step self-skips for untrusted actors but will fail for in-repo PRs, so grant them before merging or expect red previews. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent ea253ba commit fc22b5b

1 file changed

Lines changed: 62 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Build Project [using jupyter-book]
2+
on:
3+
pull_request:
4+
types: [opened, synchronize, reopened]
5+
jobs:
6+
preview:
7+
runs-on: ubuntu-latest
8+
permissions:
9+
contents: read
10+
pull-requests: write
11+
steps:
12+
- uses: actions/checkout@v7
13+
with:
14+
ref: ${{ github.event.pull_request.head.sha }}
15+
fetch-depth: 0
16+
- name: Setup Anaconda
17+
uses: conda-incubator/setup-miniconda@v4
18+
with:
19+
auto-update-conda: true
20+
auto-activate-base: true
21+
miniconda-version: 'latest'
22+
python-version: "3.13"
23+
environment-file: environment.yml
24+
activate-environment: quantecon
25+
- name: Display Conda Environment Versions
26+
shell: bash -l {0}
27+
run: conda list
28+
- name: Display Pip Versions
29+
shell: bash -l {0}
30+
run: pip list
31+
- name: Download "build" folder (cache)
32+
uses: dawidd6/action-download-artifact@v21
33+
with:
34+
workflow: cache.yml
35+
branch: main
36+
name: build-cache
37+
path: _build
38+
- name: Clear stale Sphinx environment
39+
shell: bash -l {0}
40+
run: rm -rf _build/.doctrees
41+
# HTML only for now — no PDF or notebook assets
42+
- name: Build HTML
43+
shell: bash -l {0}
44+
run: |
45+
jb build lectures --path-output ./ -n --keep-going
46+
# TODO: Re-enable -W flag once all lectures are translated and warnings are resolved
47+
- name: Upload Execution Reports
48+
uses: actions/upload-artifact@v7
49+
if: failure()
50+
with:
51+
name: execution-reports
52+
path: _build/html/reports
53+
- name: Setup Node.js
54+
uses: actions/setup-node@v6
55+
with:
56+
node-version: '20'
57+
- name: Preview Deploy to Netlify
58+
uses: quantecon/actions/preview-netlify@v0.8.0
59+
with:
60+
netlify-auth-token: ${{ secrets.NETLIFY_AUTH_TOKEN }}
61+
netlify-site-id: ${{ secrets.NETLIFY_SITE_ID }}
62+
build-dir: _build/html

0 commit comments

Comments
 (0)