Skip to content

Commit ef9c832

Browse files
committed
chore: Update .gitignore and workflows for documentation deployment and testing
Signed-off-by: longhao <[email protected]>
1 parent 6a4eff5 commit ef9c832

File tree

5 files changed

+1843
-1782
lines changed

5 files changed

+1843
-1782
lines changed

.github/workflows/publish_docs.yml

Lines changed: 42 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,42 @@
1-
name: Deploy Documentation
2-
3-
on:
4-
push:
5-
branches:
6-
- main
7-
pull_request:
8-
branches:
9-
- main
10-
workflow_dispatch:
11-
12-
jobs:
13-
deploy:
14-
runs-on: ubuntu-latest
15-
steps:
16-
- uses: actions/checkout@v3
17-
with:
18-
fetch-depth: 0
19-
20-
- name: Set up Python
21-
uses: actions/setup-python@v4
22-
with:
23-
python-version: '3.x'
24-
25-
- name: Install dependencies
26-
run: |
27-
python -m pip install --upgrade pip
28-
pip install mkdocs-material
29-
pip install -r docs/requirements.txt
30-
31-
- name: Configure Git
32-
run: |
33-
git config --global user.name "github-actions[bot]"
34-
git config --global user.email "github-actions[bot]@users.noreply.github.com"
35-
36-
- name: Deploy Documentation
37-
run: |
38-
git fetch origin gh-pages || true
39-
mkdocs gh-deploy --force
1+
name: Deploy Documentation
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
paths:
7+
- 'docs/**'
8+
- 'mkdocs.yml'
9+
- '.github/workflows/publish_docs.yml'
10+
- 'pyproject.toml'
11+
- 'poetry.lock'
12+
workflow_dispatch:
13+
14+
jobs:
15+
deploy-docs:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
22+
- name: Set up Python
23+
uses: actions/setup-python@v5
24+
with:
25+
python-version: '3.9'
26+
cache: 'pip'
27+
28+
- name: Install dependencies
29+
run: |
30+
python -m pip install --upgrade pip
31+
pip install poetry
32+
poetry config virtualenvs.create false
33+
poetry install --only docs
34+
35+
- name: Configure Git
36+
run: |
37+
git config --global user.name "github-actions[bot]"
38+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
39+
40+
- name: Deploy documentation
41+
run: |
42+
mkdocs gh-deploy --force

.github/workflows/test_docs.yaml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Test Documentation Build
2+
3+
on:
4+
pull_request:
5+
branches: [ main ]
6+
paths:
7+
- 'docs/**'
8+
- 'mkdocs.yml'
9+
- '.github/workflows/test_docs.yml'
10+
- 'pyproject.toml'
11+
- 'poetry.lock'
12+
13+
jobs:
14+
test-docs:
15+
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
python-version: ["3.9"]
19+
steps:
20+
- uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 0
23+
24+
- name: Set up Python ${{ matrix.python-version }}
25+
uses: actions/setup-python@v5
26+
with:
27+
python-version: ${{ matrix.python-version }}
28+
cache: 'pip'
29+
30+
- name: Install dependencies
31+
run: |
32+
python -m pip install --upgrade pip
33+
pip install poetry==${{ vars.POETRY_VERSION || '1.7.1' }}
34+
poetry config virtualenvs.create false
35+
poetry install --with docs
36+
37+
- name: Test documentation build
38+
run: |
39+
mkdocs build --strict
40+
41+
- name: Check for documentation warnings
42+
run: |
43+
if grep -r "WARNING" site/; then
44+
echo "Documentation contains warnings"
45+
exit 1
46+
fi

.gitignore

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,14 @@
66

77
# Vim / Notepad++ temp files
88
*~
9-
.*/
9+
10+
# Specific dot directories to ignore (but not .github)
11+
.pytest_cache/
12+
.mypy_cache/
13+
.tox/
14+
.venv/
15+
.coverage/
16+
1017
*.egg-info
1118
# PyInstaller output
1219
build/

0 commit comments

Comments
 (0)