end of lecture 2 #50
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: Render Quarto Website | |
| on: | |
| push: | |
| branches: [main, master] | |
| concurrency: | |
| group: quarto-render-${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| render: | |
| runs-on: ubuntu-latest | |
| env: | |
| # Use Node 24 for JS-based actions (checkout, setup-python, etc.); see | |
| # https://github.blog/changelog/2025-09-19-deprecation-of-node-20-on-github-actions-runners/ | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | |
| permissions: | |
| contents: write | |
| if: github.actor != 'github-actions[bot]' | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v6 | |
| with: | |
| persist-credentials: true | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Setup Quarto | |
| uses: quarto-dev/quarto-actions/setup@v2 | |
| env: | |
| # Avoids GitHub API rate limits when downloading Quarto / TinyTeX bundles. | |
| GH_TOKEN: ${{ github.token }} | |
| with: | |
| # Pin so HTML and site_libs hashes stay aligned across runs (avoid mixing | |
| # with a different local Quarto when committing docs from a laptop). | |
| version: "1.9.37" | |
| tinytex: true | |
| - name: Report Quarto version | |
| run: quarto --version | |
| - name: Install TeX fonts for syllabus PDF (Linux) | |
| run: | | |
| if command -v tlmgr >/dev/null 2>&1; then | |
| tlmgr install --no-dependents tex-gyre || true | |
| fi | |
| - name: Setup Python for Quarto execution | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.x" | |
| - name: Install Python dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install numpy matplotlib pandas ipykernel jupyter | |
| # Ensure the "python3" kernel name referenced by `jupyter: python3` is available. | |
| python -m ipykernel install --user --name python3 --display-name "Python 3" | |
| - name: Render website | |
| run: quarto render | |
| - name: Commit and push docs | |
| run: | | |
| git config --local user.email "action@github.com" | |
| git config --local user.name "GitHub Action" | |
| git add docs/ | |
| git diff --staged --quiet || git commit -m "Render Quarto website to docs/" | |
| git remote set-url origin "https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git" | |
| git push |