Repository navigation
refactor: move code includes, front matter edits and page naming out of GreatDocs #1704
Workflow file for this run
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: CI Docs | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| jobs: | |
| build-docs: | |
| name: "Build Docs" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 # Full history for accurate page timestamps | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.11" | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install -e ".[docs]" | |
| - name: Set up Quarto | |
| uses: quarto-dev/quarto-actions/setup@v2 | |
| - name: Install d2 (for rendering D2 diagrams into the docs) | |
| run: | | |
| curl -fsSL https://d2lang.com/install.sh | sh -s -- --version v0.8.2 | |
| echo "$HOME/.local/bin" >> "$GITHUB_PATH" | |
| "$HOME/.local/bin/d2" --version | |
| - name: Build docs | |
| run: great-docs build | |
| - name: Save docs artifact | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: docs-html | |
| path: docs/_site | |
| include-hidden-files: true | |
| - name: How to preview this build locally | |
| if: github.event_name == 'pull_request' | |
| run: great-docs ci notice --run ${{ github.run_id }} --pr ${{ github.event.number }} | |
| - name: Upload build timings | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: build-timings | |
| path: docs/_site/build-timings.json | |
| publish-docs: | |
| name: "Publish Docs" | |
| runs-on: ubuntu-latest | |
| needs: "build-docs" | |
| if: github.ref == 'refs/heads/main' | |
| permissions: | |
| pages: write | |
| id-token: write | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - uses: actions/download-artifact@v7 | |
| with: | |
| name: docs-html | |
| path: docs/_site | |
| - name: Upload Pages artifact | |
| uses: actions/upload-pages-artifact@v5 | |
| with: | |
| path: docs/_site | |
| include-hidden-files: true | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v5 | |
| preview-docs: | |
| name: "Preview Docs" | |
| runs-on: ubuntu-latest | |
| needs: "build-docs" | |
| if: github.event_name == 'pull_request' | |
| permissions: | |
| pull-requests: write | |
| steps: | |
| # Install the PR's own great-docs and let it post the sticky preview | |
| # comment. Running the in-repo build (rather than a released version) | |
| # means this job exercises the code under review. Kept as its own minimal | |
| # job so the docs build — which runs PR-authored code — never holds a | |
| # pull-requests:write token. continue-on-error so fork PRs (read-only | |
| # token) don't fail the run; the build job's log notice still covers them. | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.11" | |
| - name: Install great-docs | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install . | |
| - name: Post preview instructions to the PR | |
| continue-on-error: true | |
| run: great-docs ci pr-comment --run ${{ github.run_id }} --pr ${{ github.event.number }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |