Skip to content

Commit 06041b3

Browse files
authored
Update generate-vicutils-docs.yml
1 parent 01e1661 commit 06041b3

1 file changed

Lines changed: 24 additions & 8 deletions

File tree

.github/workflows/generate-vicutils-docs.yml

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
runs-on: ubuntu-latest
1616
steps:
1717
- name: Checkout repository
18-
uses: actions/checkout@v3
18+
uses: actions/checkout@v4
1919
with:
2020
token: ${{ secrets.GITHUB_TOKEN }}
2121

@@ -25,33 +25,49 @@ jobs:
2525
python-version: '3.x'
2626

2727
- name: Install pdoc
28-
run: pip install pdoc3
28+
run: |
29+
pip install pdoc3
30+
echo "pdoc3 version:"
31+
pdoc --version
32+
33+
- name: Check vicutils directory
34+
run: |
35+
echo "=== Contents of vicutils directory ==="
36+
ls -la vicutils/
37+
echo "=== Python files found ==="
38+
find vicutils/ -name "*.py" -not -name "__init__.py"
2939
3040
- name: Generate documentation
3141
run: |
3242
cd vicutils
43+
echo "=== Generating documentation ==="
3344
for file in *.py; do
34-
if [ "$file" != "__init__.py" ]; then
35-
echo "Generating docs for $file"
36-
pdoc --html --force --output-dir . "${file%.py}"
37-
# Move generated HTML to parent directory name
45+
if [ "$file" != "__init__.py" ] && [ -f "$file" ]; then
46+
echo "Processing: $file"
47+
python -m pdoc --html --force --output-dir . "${file%.py}"
48+
echo "Contents after pdoc:"
49+
ls -la
50+
# Move generated HTML
3851
if [ -d "${file%.py}" ]; then
39-
mv "${file%.py}"/index.html "${file%.py}.html" 2>/dev/null || true
52+
echo "Moving ${file%.py}/index.html to ${file%.py}.html"
53+
mv "${file%.py}"/index.html "${file%.py}.html"
4054
rm -rf "${file%.py}"
4155
fi
4256
fi
4357
done
4458
cd ..
59+
echo "=== Final vicutils contents ==="
4560
ls -la vicutils/
4661
4762
- name: Commit and push if changes
4863
run: |
4964
git config --local user.name "Vic-Nas"
5065
git config --local user.email "github-actions@github.com"
51-
git add vicutils/*.html
66+
git add vicutils/*.html || echo "No HTML files to add"
5267
if git diff --staged --quiet; then
5368
echo "No changes to commit"
5469
else
70+
echo "Committing changes"
5571
git commit -m "Auto-generate VicUtils documentation [skip ci]"
5672
git push
5773
fi

0 commit comments

Comments
 (0)