N simplex #6
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: Build and Deploy Docs | |
on: | |
push: | |
branches: [ "main" ] | |
paths: | |
- 'doc_source/**' | |
- 'src/ect/**' | |
pull_request: | |
branches: [ "main" ] | |
paths: | |
- 'doc_source/**' | |
- 'src/ect/**' | |
jobs: | |
docs: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Install uv | |
uses: astral-sh/setup-uv@v5 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version-file: "pyproject.toml" | |
- name: Install system dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y pandoc | |
- name: Create venv and install dependencies | |
run: | | |
uv venv | |
source .venv/bin/activate | |
uv pip install -e . | |
uv pip install sphinx sphinx-rtd-theme nbsphinx autopep8 myst-parser | |
- name: Build documentation | |
run: | | |
source .venv/bin/activate | |
make html | |
- name: Deploy to GitHub Pages | |
if: github.event_name == 'push' | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./docs | |
force_orphan: true |