Bump actions/setup-python from 5 to 6 (#176) #31
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Deploy Documentation to GitHub Pages | |
| "on": | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| inputs: | |
| debug_enabled: | |
| description: "Enable debug output" | |
| required: false | |
| default: "false" | |
| type: boolean | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. | |
| # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. | |
| concurrency: | |
| group: pages | |
| cancel-in-progress: false | |
| jobs: | |
| build: | |
| name: Build documentation | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.11" | |
| cache: pip | |
| cache-dependency-path: requirements-docs.txt | |
| - name: Setup Pages | |
| id: pages | |
| uses: actions/configure-pages@v5 | |
| - name: Install dependencies | |
| run: pip install -r requirements-docs.txt | |
| - name: Build with MkDocs | |
| run: mkdocs build --strict | |
| - name: Validate build output | |
| run: | | |
| set -euo pipefail | |
| echo "Validating MkDocs build output..." | |
| # Check that site directory exists and has content | |
| if [ ! -d "site" ]; then | |
| echo "::error::Build failed - site directory not found" | |
| exit 1 | |
| fi | |
| # Count generated files | |
| html_count=$(find site -name "*.html" -type f | wc -l) | |
| total_count=$(find site -type f | wc -l) | |
| echo "Build Statistics:" | |
| echo " HTML files: $html_count" | |
| echo " Total files: $total_count" | |
| if [ "$html_count" -eq 0 ]; then | |
| echo "::error::Build produced no HTML files" | |
| exit 1 | |
| fi | |
| # Check for index.html | |
| if [ ! -f "site/index.html" ]; then | |
| echo "::error::Build missing index.html" | |
| exit 1 | |
| fi | |
| echo "Build validation passed" | |
| - name: Debug build output | |
| if: github.event.inputs.debug_enabled == 'true' | |
| run: | | |
| echo "Site structure:" | |
| find site -type f | head -50 | |
| echo "" | |
| echo "Index.html preview:" | |
| head -30 site/index.html || true | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v4 | |
| with: | |
| path: ./site | |
| - name: Build summary | |
| run: | | |
| { | |
| echo "## Build Summary" | |
| echo "" | |
| echo "| Metric | Value |" | |
| echo "|--------|-------|" | |
| echo "| HTML Files | $(find site -name '*.html' -type f | wc -l) |" | |
| echo "| Total Files | $(find site -type f | wc -l) |" | |
| echo "| Total Size | $(du -sh site | cut -f1) |" | |
| echo "| Base Path | \`${{ steps.pages.outputs.base_path }}\` |" | |
| } >> "$GITHUB_STEP_SUMMARY" | |
| deploy: | |
| name: Deploy to GitHub Pages | |
| needs: build | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 | |
| - name: Deployment summary | |
| run: | | |
| { | |
| echo "## Deployment Summary" | |
| echo "" | |
| echo "**Successfully deployed to GitHub Pages**" | |
| echo "" | |
| echo "**Live URL**: ${{ steps.deployment.outputs.page_url }}" | |
| echo "" | |
| echo "| Metric | Value |" | |
| echo "|--------|-------|" | |
| echo "| Trigger | \`${{ github.event_name }}\` |" | |
| echo "| Commit | \`${{ github.sha }}\` |" | |
| echo "| Branch | \`${{ github.ref_name }}\` |" | |
| } >> "$GITHUB_STEP_SUMMARY" |