This repository has been archived by the owner on Oct 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
modified: .github/workflows/sphinx.yml
- Loading branch information
Showing
1 changed file
with
57 additions
and
24 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,30 +1,63 @@ | ||
name: Sphinx build | ||
name: Deploy to GitHub Pages | ||
|
||
on: | ||
on: | ||
push: | ||
branches: | ||
- main | ||
branches: [main] | ||
|
||
jobs: | ||
build: | ||
deploy-to-pages: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Build HTML | ||
uses: ammaraskar/sphinx-action@master | ||
with: | ||
docs-folder: "docs/" | ||
build-command: | | ||
sphinx-build -b html . _build/html | ||
sphinx-build -D language=en -b html . _build/html/en | ||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v1 | ||
with: | ||
name: html-docs | ||
path: docs/_build/html/ | ||
- name: Deploy | ||
uses: peaceiris/actions-gh-pages@v3 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: docs/_build/html | ||
- name: 🛎️ Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 # fetch all history so that last modified date-times are accurate | ||
|
||
- name: 🐍 Set up Python 3.10 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: "3.10" | ||
|
||
- name: 🧳 Cache pip | ||
uses: actions/cache@v2 | ||
with: | ||
# This path is specific to Ubuntu | ||
path: ~/.cache/pip | ||
# Look to see if there is a cache hit for the corresponding requirements file | ||
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }} | ||
restore-keys: | | ||
${{ runner.os }}-pip- | ||
${{ runner.os }}- | ||
# - name: 👷 Install Dot and pandoc | ||
# run: | | ||
# conda install -c conda-forge pandoc | ||
# conda install -c conda-forge ipython | ||
# pip install sphinxcontrib-websupport | ||
# sudo apt update | ||
# sudo apt install -y graphviz | ||
|
||
- name: 👷 Install dependencies | ||
shell: bash | ||
run: | | ||
pip install --upgrade pip | ||
pip install -r docs/requirements.txt | ||
- name: 🔧 Build HTML | ||
run: | | ||
cd docs | ||
make html | ||
sphinx-build -D language=en -b html ./ _build/html/en | ||
# remove the .doctrees folder when building for deployment as it takes two thirds of disk space | ||
- name: 🔥 Clean up files | ||
run: rm -r docs/_build/doctrees/ | ||
|
||
- name: 🚀 Deploy to GitHub pages | ||
uses: peaceiris/[email protected] | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: docs/_build/html | ||
user_name: "github-actions[bot]" | ||
user_email: "github-actions[bot]@users.noreply.github.com" |