Merge pull request #43 from 2i2c-org/port-docs #11
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
name: Build and Deploy Handbook | |
on: | |
# Trigger the workflow when changes in the handbook/ folder are pushed to the | |
# main branch | |
push: | |
branches: | |
- main | |
paths: | |
- "handbook/**" | |
# Trigger the workflow manually | |
workflow_dispatch: | |
jobs: | |
# This job installs dependencies, builds the book, and pushes the generated | |
# html files to the `gh-pages` branch | |
build-and-deploy-book: | |
runs-on: ubuntu-latest | |
# This job needs to commit changes to a branch, which requires write | |
# permissions to the content of the repo | |
# ref: https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
# Install dependencies | |
- name: Set up Python v3.10 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
- name: Install dependencies | |
run: | | |
pip install -r handbook/requirements.txt | |
# Build the book | |
- name: Build the book | |
run: | | |
jupyter-book build handbook | |
# Deploy the book's HTML to gh-pages branch | |
- name: GitHub Pages action | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: handbook/_build/html |