@@ -14,41 +14,23 @@ jobs:
1414 - name : Checkout
1515 uses : actions/checkout@v4
1616
17- - name : Setup Ruby
18- uses : ruby /setup-ruby@v1
17+ - name : Setup Python
18+ uses : actions /setup-python@v5
1919 with :
20- ruby -version : " 3.3 "
21- bundler- cache : true
20+ python -version : " 3.12 "
21+ cache : pip
2222
23- - name : Build Jekyll
24- run : bundle exec jekyll build --baseurl ""
25- env :
26- JEKYLL_ENV : production
23+ - name : Install dependencies
24+ run : pip install -r requirements.txt
2725
28- - name : Check for broken internal links
29- run : |
30- echo "Checking for broken internal links..."
31- ERRORS=0
32- for link in $(grep -roh 'href="/[^"]*"' _site/ --include="*.html" | sed 's/href="//;s/"$//' | sort -u); do
33- CLEAN_LINK=$(echo "$link" | sed 's/#.*//' | sed 's|/$||')
34- if [ -z "$CLEAN_LINK" ]; then continue; fi
35- if [ ! -f "_site${CLEAN_LINK}.html" ] && [ ! -f "_site${CLEAN_LINK}/index.html" ] && [ ! -f "_site${CLEAN_LINK}" ]; then
36- echo "::warning::Broken link: $link"
37- ERRORS=$((ERRORS + 1))
38- fi
39- done
40- if [ "$ERRORS" -gt 0 ]; then
41- echo "::warning::Found $ERRORS potentially broken internal links"
42- else
43- echo "All internal links valid."
44- fi
26+ - name : Build MkDocs (strict)
27+ run : mkdocs build --strict
4528
46- - name : Validate HTML structure
29+ - name : Validate output
4730 run : |
48- echo "Checking generated HTML files..."
49- HTML_COUNT=$(find _site -name "*.html" | wc -l)
31+ HTML_COUNT=$(find site -name "*.html" | wc -l)
5032 echo "Generated $HTML_COUNT HTML files"
5133 if [ "$HTML_COUNT" -eq 0 ]; then
52- echo "::error::No HTML files generated — build may have failed silently "
34+ echo "::error::No HTML files generated"
5335 exit 1
5436 fi
0 commit comments