banner #192
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 and Publish | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
# Allow manual triggering | |
workflow_dispatch: | |
# Prevent concurrent deployments to avoid conflicts | |
concurrency: | |
group: "pages" | |
cancel-in-progress: false | |
jobs: | |
# Build job - runs on both push and PR | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
- name: Install Python dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install jupyter nbformat | |
- name: Set up Quarto | |
uses: quarto-dev/quarto-actions/setup@v2 | |
with: | |
# Cache Quarto installation for faster builds | |
tinytex: true | |
- name: Render Quarto Project | |
uses: quarto-dev/quarto-actions/render@v2 | |
- name: Setup Pages | |
if: github.ref == 'refs/heads/main' | |
uses: actions/configure-pages@v4 | |
- name: Upload build artifact | |
if: github.ref == 'refs/heads/main' | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: ./_site | |
# Deploy job - only runs on main branch push | |
deploy: | |
if: github.ref == 'refs/heads/main' | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
needs: build | |
permissions: | |
pages: write | |
id-token: write | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |