-
Notifications
You must be signed in to change notification settings - Fork 1
56 lines (49 loc) · 1.46 KB
/
docs.yml
File metadata and controls
56 lines (49 loc) · 1.46 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
name: Build and Deploy Docs
on:
push:
branches: [ "main" ]
paths:
- 'doc_source/**'
- 'src/ect/**'
jobs:
docs:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version-file: "pyproject.toml"
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y pandoc
- name: Create venv and install dependencies
run: |
uv venv
source .venv/bin/activate
uv pip install -e .
uv pip install sphinx sphinx-rtd-theme nbsphinx autopep8 myst-parser
- name: Build documentation
run: |
source .venv/bin/activate
make html
- name: Configure Git
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
- name: Commit and push if changed
run: |
if [[ -n "$(git status --porcelain docs/)" ]]; then
git add docs/
git commit -m "docs: auto-generate documentation"
git push origin HEAD:main
else
echo "No changes to commit"
fi