Skip to content

Commit 18a0ef1

Browse files
committed
fix(CI): docs workflow
1 parent 950adea commit 18a0ef1

5 files changed

Lines changed: 1185 additions & 71 deletions

File tree

.github/workflows/build_docs.yml

Lines changed: 0 additions & 66 deletions
This file was deleted.

.github/workflows/docs.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Build and Deploy Documentation
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
12+
env:
13+
VIRTUAL_ENV: "venv"
14+
UV_ACTIVE: 1
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v6
19+
20+
- name: Install uv
21+
uses: astral-sh/setup-uv@v7
22+
23+
- name: Set up Python
24+
run: uv python install
25+
26+
- name: Install the project
27+
run: |
28+
uv sync --dev
29+
30+
- name: Build documentation
31+
run: sphinx-build -b html docs/source docs/build/
32+
33+
- name: Commit and Stash Documentation
34+
run: |
35+
git add -f docs/build/
36+
git stash
37+
38+
- name: Checkout gh-pages
39+
uses: actions/checkout@v6
40+
with:
41+
ref: gh-pages
42+
43+
- name: Configure Git
44+
run: |
45+
git config user.name github-actions
46+
git config user.email github-actions@github.com
47+
48+
- name: Cleanup Old Folders
49+
run: |
50+
rm -rf _static/
51+
rm -rf _modules/
52+
rm -rf _sources/
53+
rm -rf examples/
54+
rm -rf modules/
55+
56+
- name: Deploy to gh-pages
57+
run: |
58+
git stash pop
59+
mv -f docs/build/* .
60+
rm -rf docs/build
61+
git add .
62+
git commit -m "Auto update docs"
63+
git push

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ docs/html
1010
docs/build/
1111

1212
# General files to ignore
13-
.DS_Store
1413
*.html
1514

1615
# Specific files to ignore
17-
uv.lock
16+
.DS_Store
17+
.envrc
1818

1919
# Package folders to ignore
2020
p2obp/tests/data/

pyproject.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,12 @@ dependencies = [
3535
[tool.setuptools.dynamic]
3636
version = { attr = "p2obt.__version__" }
3737

38-
[tool.uv]
39-
dev-dependencies = [
38+
[dependency-groups]
39+
dev = [
4040
"numpydoc>=1.8.0",
4141
"pydata-sphinx-theme>=0.16.0",
4242
"pytest>=8.3.3",
4343
"sphinx>=7.4.7",
44-
"sphinx-autobuild>=2024.10.3",
4544
"sphinx-autodoc-typehints>=2.3.0",
4645
]
4746

0 commit comments

Comments
 (0)