File tree Expand file tree Collapse file tree 1 file changed +40
-0
lines changed
Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Generate VicUtils Docs
2+
3+ on :
4+ push :
5+ paths :
6+ - ' vicutils/**/*.py'
7+ branches :
8+ - main
9+
10+ jobs :
11+ generate-docs :
12+ runs-on : ubuntu-latest
13+ steps :
14+ - uses : actions/checkout@v3
15+
16+ - uses : actions/setup-python@v4
17+ with :
18+ python-version : ' 3.x'
19+
20+ - name : Install pdoc
21+ run : pip install pdoc3
22+
23+ - name : Generate documentation
24+ run : |
25+ cd vicutils
26+ for file in *.py; do
27+ if [ "$file" != "__init__.py" ]; then
28+ pdoc --html --force --output-dir . "${file%.py}"
29+ # Move generated HTML to parent directory name
30+ mv "${file%.py}"/index.html "${file%.py}.html" 2>/dev/null || true
31+ rm -rf "${file%.py}"
32+ fi
33+ done
34+
35+ - name : Commit and push if changes
36+ run : |
37+ git config user.name "Vic-Nas"
38+ git config user.email "github-actions@github.com"
39+ git add vicutils/*.html
40+ git diff --quiet && git diff --staged --quiet || (git commit -m "Auto-generate VicUtils documentation" && git push)
You can’t perform that action at this time.
0 commit comments