Skip to content

ci: Validate JupyterBook build on PRs without deploying #29

ci: Validate JupyterBook build on PRs without deploying

ci: Validate JupyterBook build on PRs without deploying #29

Workflow file for this run

name: Render JupyterBook
on:
push:
branches:
- main
- master
- setup_jupyter_book
pull_request:
branches:
- main
workflow_dispatch: # allow manual triggers
permissions:
contents: read
# Cancel superseded PR builds, but never cancel an in-progress Pages deployment
concurrency:
group: ${{ github.event_name == 'pull_request' && format('pr-{0}', github.ref) || 'pages' }}
cancel-in-progress: true
jobs:
build:
# Compile the book on every push and pull request. PRs stop here.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
pip3 install "jupyter-book<2.0.0"
- name: Build JupyterBook
run: |
jupyter-book build .
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v4
with:
path: '_build/html'
deploy:
# Publish only for pushes and manual runs; pull requests never deploy.
if: github.event_name != 'pull_request'
needs: build
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4