-
Notifications
You must be signed in to change notification settings - Fork 6
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
1 parent
fae5822
commit 22d2c2f
Showing
1 changed file
with
28 additions
and
16 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,39 @@ | ||
name: Publish documentation via GitHub Pages | ||
name: Build and Deploy Documentation | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- main # or your default branch | ||
- 72-api-documentation-with-sphinx | ||
|
||
jobs: | ||
build: | ||
name: Deploy docs | ||
build-and-deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout main | ||
uses: actions/checkout@v2 | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 # Fetch all history for .git-restore-mtime to work correctly | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.x' | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install .[docs] | ||
- name: Build MkDocs site | ||
run: mkdocs build --config-file mkdocs.yml --site-dir ./site | ||
|
||
- name: Deploy mkdocs (general) documentation | ||
uses: mhausenblas/mkdocs-deploy-gh-pages@master | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
REQUIREMENTS: docs/general/requirements.txt | ||
- name: Build Sphinx docs | ||
run: | | ||
sphinx-build -b html docs/api site/api | ||
- name: Deploy sphinx (API) documentation | ||
uses: sphinx-notes/pages@v3 | ||
- name: Deploy to GitHub Pages | ||
uses: peaceiris/actions-gh-pages@v4 | ||
with: | ||
checkout: false | ||
publish: false | ||
documentation_path: docs/api | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: ./site | ||
force_orphan: true |