Skip to content

Grant actions write access to gh-pages + force_orphan on first deploy #2

Grant actions write access to gh-pages + force_orphan on first deploy

Grant actions write access to gh-pages + force_orphan on first deploy #2

Workflow file for this run

name: Deploy Jupyter Book
on:
push:
branches: ["main"]
workflow_dispatch:
permissions:
contents: write # <<< allow pushing to gh-pages
jobs:
build-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install deps
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Build Jupyter Book
run: |
jupyter-book build book
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./book/_build/html
publish_branch: gh-pages
force_orphan: true