Skip to content

Commit e8a88c5

Browse files
committed
馃摎 Add complete documentation system with CI/CD
- Add Sphinx documentation (docs/) - Add GitHub Actions workflow for docs build - Add Read the Docs configuration - Documentation includes: quickstart, configuration, authentication, API reference - Auto-deploy to GitHub Pages on push
1 parent dee243d commit e8a88c5

17 files changed

Lines changed: 3107 additions & 0 deletions

.github/workflows/docs.yml

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
name: Build and Deploy Documentation
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- gh
8+
pull_request:
9+
branches:
10+
- main
11+
12+
permissions:
13+
contents: write
14+
pages: write
15+
id-token: write
16+
17+
jobs:
18+
build-docs:
19+
runs-on: ubuntu-latest
20+
21+
steps:
22+
- name: 📥 Checkout code
23+
uses: actions/checkout@v4
24+
with:
25+
fetch-depth: 0
26+
27+
- name: 🐍 Set up Python
28+
uses: actions/setup-python@v4
29+
with:
30+
python-version: '3.11'
31+
32+
- name: 📦 Install dependencies
33+
run: |
34+
python -m pip install --upgrade pip
35+
pip install -r docs/requirements.txt
36+
pip install -e .
37+
38+
- name: 🔨 Build documentation
39+
run: |
40+
cd docs
41+
make html
42+
43+
- name: 📊 Check build
44+
run: |
45+
if [ ! -d "docs/_build/html" ]; then
46+
echo "❌ Build failed - no output directory"
47+
exit 1
48+
fi
49+
echo "✅ Documentation built successfully"
50+
ls -la docs/_build/html
51+
52+
- name: 🚀 Deploy to GitHub Pages
53+
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/gh')
54+
uses: peaceiris/actions-gh-pages@v3
55+
with:
56+
github_token: ${{ secrets.GITHUB_TOKEN }}
57+
publish_dir: ./docs/_build/html
58+
publish_branch: gh-pages
59+
force_orphan: true
60+
user_name: 'github-actions[bot]'
61+
user_email: 'github-actions[bot]@users.noreply.github.com'
62+
commit_message: '📚 Deploy documentation from ${{ github.ref }}'
63+
64+
- name: 📤 Upload artifacts
65+
uses: actions/upload-artifact@v3
66+
with:
67+
name: documentation
68+
path: docs/_build/html
69+
retention-days: 30
70+
71+
- name: ✅ Summary
72+
run: |
73+
echo "### 📚 Documentation Build Summary" >> $GITHUB_STEP_SUMMARY
74+
echo "" >> $GITHUB_STEP_SUMMARY
75+
echo "✅ Build completed successfully" >> $GITHUB_STEP_SUMMARY
76+
echo "📦 Branch: \`${{ github.ref_name }}\`" >> $GITHUB_STEP_SUMMARY
77+
echo "🔗 Commit: \`${{ github.sha }}\`" >> $GITHUB_STEP_SUMMARY
78+
if [ "${{ github.event_name }}" == "push" ]; then
79+
echo "🚀 Deployed to GitHub Pages" >> $GITHUB_STEP_SUMMARY
80+
fi
81+
82+
lint-docs:
83+
runs-on: ubuntu-latest
84+
85+
steps:
86+
- name: 📥 Checkout code
87+
uses: actions/checkout@v4
88+
89+
- name: 🐍 Set up Python
90+
uses: actions/setup-python@v4
91+
with:
92+
python-version: '3.11'
93+
94+
- name: 📦 Install doc8
95+
run: |
96+
pip install doc8 sphinx
97+
98+
- name: 🔍 Lint documentation
99+
run: |
100+
cd docs
101+
doc8 . --ignore D001 --max-line-length 100 || true
102+
echo "✅ Documentation linting completed"
103+

.readthedocs.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Read the Docs configuration file
2+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
3+
4+
version: 2
5+
6+
# Build documentation in the docs/ directory with Sphinx
7+
sphinx:
8+
configuration: docs/conf.py
9+
fail_on_warning: false
10+
11+
# Optionally build your docs in additional formats such as PDF and ePub
12+
formats:
13+
- pdf
14+
- epub
15+
16+
# Set the version of Python and requirements required to build your docs
17+
build:
18+
os: ubuntu-22.04
19+
tools:
20+
python: "3.11"
21+
jobs:
22+
post_create_environment:
23+
- pip install poetry
24+
post_install:
25+
- pip install -r docs/requirements.txt
26+
27+
python:
28+
install:
29+
- method: pip
30+
path: .
31+
extra_requirements:
32+
- docs
33+

docs/.gitignore

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Sphinx build directories
2+
_build/
3+
_static/
4+
_templates/
5+
6+
# Python cache
7+
__pycache__/
8+
*.py[cod]
9+
*$py.class
10+
11+
# Generated files
12+
*.log
13+
*.pot
14+
15+
# Distribution / packaging
16+
.eggs/
17+
*.egg-info/
18+
19+
# IDE
20+
.vscode/
21+
.idea/
22+
*.swp
23+
*.swo
24+
*~
25+

docs/Makefile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line, and also
5+
# from the environment for the first two.
6+
SPHINXOPTS ?=
7+
SPHINXBUILD ?= sphinx-build
8+
SOURCEDIR = .
9+
BUILDDIR = _build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
21+

0 commit comments

Comments
 (0)