Set up GitHub Pages publishing #1
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build Project [using jupyter-book] | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| jobs: | |
| preview: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| fetch-depth: 0 | |
| - name: Setup Anaconda | |
| uses: conda-incubator/setup-miniconda@v4 | |
| with: | |
| auto-update-conda: true | |
| auto-activate-base: true | |
| miniconda-version: 'latest' | |
| python-version: "3.13" | |
| environment-file: environment.yml | |
| activate-environment: quantecon | |
| - name: Display Conda Environment Versions | |
| shell: bash -l {0} | |
| run: conda list | |
| - name: Display Pip Versions | |
| shell: bash -l {0} | |
| run: pip list | |
| - name: Download "build" folder (cache) | |
| uses: dawidd6/action-download-artifact@v21 | |
| with: | |
| workflow: cache.yml | |
| branch: main | |
| name: build-cache | |
| path: _build | |
| - name: Clear stale Sphinx environment | |
| shell: bash -l {0} | |
| run: rm -rf _build/.doctrees | |
| # HTML only for now — no PDF or notebook assets | |
| - name: Build HTML | |
| shell: bash -l {0} | |
| run: | | |
| jb build lectures --path-output ./ -n --keep-going | |
| # TODO: Re-enable -W flag once all lectures are translated and warnings are resolved | |
| - name: Upload Execution Reports | |
| uses: actions/upload-artifact@v7 | |
| if: failure() | |
| with: | |
| name: execution-reports | |
| path: _build/html/reports | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: '20' | |
| - name: Preview Deploy to Netlify | |
| uses: quantecon/actions/preview-netlify@v0.8.0 | |
| with: | |
| netlify-auth-token: ${{ secrets.NETLIFY_AUTH_TOKEN }} | |
| netlify-site-id: ${{ secrets.NETLIFY_SITE_ID }} | |
| build-dir: _build/html |