-
Notifications
You must be signed in to change notification settings - Fork 32
45 lines (41 loc) · 1.33 KB
/
docs.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: Docs
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ["3.10"]
- name: Install dependencies
run: |
sudo apt update -y
sudo apt install graphviz # Needed for documentation
python -m pip install --upgrade pip
pip install -r requirements.txt -r requirements-dev.txt -r requirements-doc.txt
- name: Build Sphinx documentation
run: |
cd docs
make html SPHINXOPTS="-W --keep-going -n"
- name: Commit documentation changes to gh-pages branch
run: |
git clone https://github.com/sgkit-dev/sgkit.git --branch gh-pages --single-branch gh-pages
mkdir -p gh-pages/latest
cp -r docs/_build/html/* gh-pages/latest
cd gh-pages
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add .
git commit -m "Update latest documentation" -a || true # Ignore error if no changes present
- name: Push changes
uses: ad-m/github-push-action@master
with:
branch: gh-pages
directory: gh-pages
force: true
github_token: ${{ secrets.GITHUB_TOKEN }}