Publish the book #746
This file contains 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
# Publish the documentation on merge and nightly | |
name: Publish the book | |
on: | |
push: | |
branches: [main] | |
schedule: | |
# every day at 4:00 -- ready for my morning coffee | |
# cheks compatibility with blackjax-nightly | |
- cron: '0 4 * * *' | |
workflow_dispatch: | |
jobs: | |
publish: | |
name: Publish | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout the branch | |
uses: actions/checkout@v3 | |
- name: Jupyter Book cache | |
id: cache | |
uses: actions/cache@v3 | |
with: | |
path: ./jupyter_cache | |
key: jupyter-cache-${{ github.run_id }} | |
restore-keys: | | |
jupyter-cache | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.11 | |
- name: Install dependencies | |
run: | | |
pip install -r requirements.txt | |
- name: Build the book | |
run: | | |
mkdir -p ./jupyter_cache | |
jupyter-book build -nv --keep-going book | |
- name: Publish to GitHub Pages | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
branch: gh-pages | |
folder: ./book/_build/html | |
clean: true |