Skip to content
This repository was archived by the owner on Oct 26, 2024. It is now read-only.

Commit e271ad0

Browse files
committed
modified: .github/workflows/sphinx.yml
1 parent e5664b4 commit e271ad0

File tree

1 file changed

+57
-24
lines changed

1 file changed

+57
-24
lines changed

.github/workflows/sphinx.yml

Lines changed: 57 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,63 @@
1-
name: Sphinx build
1+
name: Deploy to GitHub Pages
22

3-
on:
3+
on:
44
push:
5-
branches:
6-
- main
5+
branches: [main]
76

87
jobs:
9-
build:
8+
deploy-to-pages:
109
runs-on: ubuntu-latest
10+
1111
steps:
12-
- uses: actions/checkout@v2
13-
- name: Build HTML
14-
uses: ammaraskar/sphinx-action@master
15-
with:
16-
docs-folder: "docs/"
17-
build-command: |
18-
sphinx-build -b html . _build/html
19-
sphinx-build -D language=en -b html . _build/html/en
20-
21-
- name: Upload artifacts
22-
uses: actions/upload-artifact@v1
23-
with:
24-
name: html-docs
25-
path: docs/_build/html/
26-
- name: Deploy
27-
uses: peaceiris/actions-gh-pages@v3
28-
with:
29-
github_token: ${{ secrets.GITHUB_TOKEN }}
30-
publish_dir: docs/_build/html
12+
- name: 🛎️ Checkout
13+
uses: actions/checkout@v2
14+
with:
15+
fetch-depth: 0 # fetch all history so that last modified date-times are accurate
16+
17+
- name: 🐍 Set up Python 3.10
18+
uses: actions/setup-python@v2
19+
with:
20+
python-version: "3.10"
21+
22+
- name: 🧳 Cache pip
23+
uses: actions/cache@v2
24+
with:
25+
# This path is specific to Ubuntu
26+
path: ~/.cache/pip
27+
# Look to see if there is a cache hit for the corresponding requirements file
28+
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
29+
restore-keys: |
30+
${{ runner.os }}-pip-
31+
${{ runner.os }}-
32+
33+
# - name: 👷‍ Install Dot and pandoc
34+
# run: |
35+
# conda install -c conda-forge pandoc
36+
# conda install -c conda-forge ipython
37+
# pip install sphinxcontrib-websupport
38+
# sudo apt update
39+
# sudo apt install -y graphviz
40+
41+
- name: 👷‍ Install dependencies
42+
shell: bash
43+
run: |
44+
pip install --upgrade pip
45+
pip install -r docs/requirements.txt
46+
47+
- name: 🔧 Build HTML
48+
run: |
49+
cd docs
50+
make html
51+
sphinx-build -D language=en -b html ./ _build/html/en
52+
53+
# remove the .doctrees folder when building for deployment as it takes two thirds of disk space
54+
- name: 🔥 Clean up files
55+
run: rm -r docs/_build/doctrees/
56+
57+
- name: 🚀 Deploy to GitHub pages
58+
uses: peaceiris/[email protected]
59+
with:
60+
github_token: ${{ secrets.GITHUB_TOKEN }}
61+
publish_dir: docs/_build/html
62+
user_name: "github-actions[bot]"
63+
user_email: "github-actions[bot]@users.noreply.github.com"

0 commit comments

Comments
 (0)