-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
44 additions
and
21 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,50 @@ | ||
name: documentation | ||
name: Documentation | ||
|
||
on: [push, pull_request, workflow_dispatch] | ||
|
||
permissions: | ||
contents: write | ||
on: | ||
push: | ||
branches: [ site ] | ||
pull_request: | ||
branches: [ site ] | ||
|
||
jobs: | ||
docs: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
- name: Install dependencies | ||
run: | | ||
pip install sphinx myst-parser nbsphinx furo | ||
- name: Sphinx build | ||
run: | | ||
sphinx-build docs/docs/source _build | ||
- name: Deploy to GitHub Pages | ||
uses: peaceiris/actions-gh-pages@v3 | ||
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | ||
with: | ||
publish_branch: gh-pages | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: _build/ | ||
force_orphan: true | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: site | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: '3.11' | ||
|
||
- name: Install pandoc | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y pandoc | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install .[docs] | ||
pip install sphinx nbsphinx myst-parser furo | ||
- name: Install package in editable mode | ||
run: | | ||
pip install -e . | ||
- name: Build documentation | ||
run: | | ||
cd docs/docs | ||
sphinx-build -b html source _build/html | ||
- name: Deploy to GitHub Pages | ||
if: github.event_name == 'push' && github.ref == 'refs/heads/site' | ||
uses: peaceiris/actions-gh-pages@v3 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: docs/docs/_build/html | ||
publish_branch: gh-pages | ||
force_orphan: true | ||
commit_message: "Deploy documentation updates" |