Deploy Documentation #77
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 | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'docs/**' | |
| - '.github/workflows/deploy-docs.yml' | |
| # Redeploy after a successful release so the Quick Start version (injected | |
| # below from the latest git tag) tracks the newest release automatically. | |
| # Using workflow_run (not a gh workflow_dispatch from the CI job) because a | |
| # workflow_dispatch triggered by GITHUB_TOKEN is suppressed by GitHub's | |
| # recursion guard and would never fire. | |
| workflow_run: | |
| workflows: ["ci"] | |
| types: | |
| - completed | |
| workflow_dispatch: | |
| # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
| 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: | |
| deploy: | |
| name: Deploy to GitHub Pages | |
| runs-on: ubuntu-latest | |
| # For workflow_run, only deploy after a SUCCESSFUL release CI run (a tag | |
| # push β head_branch is the tag name, e.g. "v1.29.0"). This keeps regular | |
| # main-branch commits from redeploying via this path (the push trigger | |
| # above already handles docs/** changes). | |
| if: >- | |
| github.event_name != 'workflow_run' || | |
| (github.event.workflow_run.conclusion == 'success' && | |
| startsWith(github.event.workflow_run.head_branch, 'v')) | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v6 | |
| - name: Create .nojekyll file | |
| run: | | |
| touch docs/.nojekyll | |
| echo "Created .nojekyll file to bypass Jekyll processing" | |
| # Rewrite the Quick Start example version to the latest release tag at | |
| # publish time (not committed), so the live docs always match the newest | |
| # release without pushing to the protected main branch. | |
| - name: Sync Quick Start version to latest release | |
| run: ./scripts/update_docs_version.sh | |
| - name: Verify documentation structure | |
| run: | | |
| echo "Documentation structure:" | |
| ls -la docs/ | |
| echo "" | |
| echo "Checking for required files..." | |
| test -f docs/index.html && echo "β index.html found" || echo "β index.html missing" | |
| test -f docs/documentation.md && echo "β documentation.md found" || echo "β documentation.md missing" | |
| test -f docs/_sidebar.md && echo "β _sidebar.md found" || echo "β _sidebar.md missing" | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v5 | |
| with: | |
| path: 'docs' | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v5 | |
| - name: Output deployment URL | |
| run: | | |
| echo "Documentation deployed successfully!" | |
| echo "URL: ${{ steps.deployment.outputs.page_url }}" |