-
Notifications
You must be signed in to change notification settings - Fork 1
64 lines (54 loc) · 1.56 KB
/
docs.yml
File metadata and controls
64 lines (54 loc) · 1.56 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: Docs
on:
push:
branches: ["main"]
jobs:
Build-Docs:
if: false # TODO: remove this line to enable this workflow
name: Build docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
version: "0.9.2"
python-version: "3.10"
enable-cache: true
- name: Install dependencies
run: |
uv venv .venv
uv sync --locked --dev --group docs
- name: Build the sphinx docs
run: |
uv run sphinx-apidoc -f -o ./sphinx/source ./src/<package_name>
uv run make -C sphinx clean
uv run python sphinx/clean_html_files.py
uv run make -C sphinx html
touch sphinx/build/html/.nojekyll
- name: Checkout gh-pages branch
run: |
git checkout -b gh-pages
git init
- name: Copy build files to docs folder
run: |
cp -a sphinx/build/html/. docs/
uv run python sphinx/make_html_files_list.py
rm -rf sphinx/build
- name: Commit to gh-pages branch
run: |
git add -f docs
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git commit -m "Update docs"
- name: Push to gh-pages branch
uses: ad-m/github-push-action@master
with:
github_token: ${{secrets.GITHUB_TOKEN}}
branch: gh-pages
force: true
directory: docs