Skip to content

⬆ Bump actions/download-artifact from 5 to 6 #2

⬆ Bump actions/download-artifact from 5 to 6

⬆ Bump actions/download-artifact from 5 to 6 #2

name: Documentation (Docusaurus) Build Check
on:
pull_request:
paths:
# Documentation CI workflow
- ".github/workflows/docs-build-check.yaml"
- ".github/workflows/documentation.yaml"
# Documentation dependencies
- "docs/package.json"
- "docs/pnpm-lock.yaml"
# Docusaurus configuration
- "docs/docusaurus.config.ts"
- "docs/tsconfig.json"
# Documentation content
- "docs/**/*.md"
- "docs/**/*.mdx"
- "docs/**/*.ts"
- "docs/**/*.tsx"
- "docs/**/*.js"
- "docs/**/*.jsx"
- "docs/**/*.css"
- "docs/**/*.json"
# Docusaurus versioning
- "docs/*_versions.json"
- "docs/*_versioned_docs/**"
- "docs/*_versioned_sidebars/**"
# Static assets
- "docs/static/**"
- "docs/src/**"
permissions:
contents: read
# Allow cancelling in-progress runs for the same PR/branch
concurrency:
group: docs-build-${{ github.ref }}
cancel-in-progress: true
jobs:
build_docs:
name: Build Documentation
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v5
with:
fetch-depth: 1 # Shallow clone for build check
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 10
run_install: false
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: '22'
cache: 'pnpm'
cache-dependency-path: docs/pnpm-lock.yaml
- name: Install dependencies
working-directory: ./docs
run: pnpm install --frozen-lockfile
# - name: Type check
# working-directory: ./docs
# run: pnpm typecheck
- name: Build documentation
working-directory: ./docs
run: pnpm build
- name: Check build output
run: |
if [ ! -d "docs/build" ]; then
echo "❌ Build directory not found!"
exit 1
fi
if [ ! -f "docs/build/index.html" ]; then
echo "❌ Main index.html not generated!"
exit 1
fi
# Check for common build artifacts
BUILD_SIZE=$(du -sh docs/build | cut -f1)
echo "βœ… Documentation built successfully!"
echo "πŸ“ Build size: $BUILD_SIZE"
echo "πŸ“„ Files generated: $(find docs/build -type f | wc -l)"
- name: Validate build quality
run: |
# Check for broken links in build output (basic validation)
cd docs/build
# Count HTML files
HTML_COUNT=$(find . -name "*.html" | wc -l)
echo "πŸ” HTML files generated: $HTML_COUNT"
if [ "$HTML_COUNT" -lt 5 ]; then
echo "⚠️ Warning: Very few HTML files generated ($HTML_COUNT)"
echo "This might indicate a build issue"
fi
# Check for critical files
CRITICAL_FILES=("index.html" "404.html")
for file in "${CRITICAL_FILES[@]}"; do
if [ -f "$file" ]; then
echo "βœ… Critical file found: $file"
else
echo "⚠️ Critical file missing: $file"
fi
done
- name: Build summary
if: always()
run: |
echo "## πŸ“š Documentation Build Summary" >> $GITHUB_STEP_SUMMARY
if [ -d "docs/build" ]; then
BUILD_SIZE=$(du -sh docs/build | cut -f1)
FILE_COUNT=$(find docs/build -type f | wc -l)
HTML_COUNT=$(find docs/build -name "*.html" | wc -l)
echo "βœ… **Build Status**: Success" >> $GITHUB_STEP_SUMMARY
echo "πŸ“ **Build Size**: $BUILD_SIZE" >> $GITHUB_STEP_SUMMARY
echo "πŸ“„ **Total Files**: $FILE_COUNT" >> $GITHUB_STEP_SUMMARY
echo "🌐 **HTML Pages**: $HTML_COUNT" >> $GITHUB_STEP_SUMMARY
else
echo "❌ **Build Status**: Failed" >> $GITHUB_STEP_SUMMARY
echo "The documentation build did not complete successfully." >> $GITHUB_STEP_SUMMARY
fi