docs(sentry): enhance documentation for Sentry integration and error … #56
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: Docs | |
| on: | |
| push: | |
| branches: [main, 'v[0-9]+.[0-9]+.[0-9]+*'] | |
| paths: | |
| - docs/** | |
| - src/** | |
| - tests/** | |
| - pyproject.toml | |
| - uv.lock | |
| - .github/workflows/docs.yml | |
| pull_request: | |
| branches: [main, 'v[0-9]+.[0-9]+.[0-9]+*'] | |
| paths: | |
| - docs/** | |
| - src/** | |
| - tests/** | |
| - pyproject.toml | |
| - uv.lock | |
| - .github/workflows/docs.yml | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
| env: | |
| PYTHON_VERSION: 3.13.8 | |
| ARTIFACT_RETENTION_DAYS: 7 | |
| WAIT_INTERVAL_SECONDS: 30 | |
| jobs: | |
| changes: | |
| name: File Detection | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| outputs: | |
| docs: ${{ steps.set_outputs.outputs.docs }} | |
| code: ${{ steps.set_outputs.outputs.code }} | |
| any: ${{ steps.set_outputs.outputs.any }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| - name: Check Docs | |
| uses: tj-actions/changed-files@v46 | |
| id: docs_changes | |
| with: | |
| files: | | |
| docs/** | |
| .github/workflows/docs.yml | |
| - name: Check Code | |
| uses: tj-actions/changed-files@v46 | |
| id: code_changes | |
| with: | |
| files: | | |
| src/** | |
| tests/** | |
| pyproject.toml | |
| uv.lock | |
| - name: Set Outputs | |
| id: set_outputs | |
| run: ./.github/scripts/docs.sh set-change-outputs \ "${{ steps.docs_changes.outputs.any_changed }}" | |
| \ "${{ steps.code_changes.outputs.any_changed }}" | |
| wait: | |
| name: Wait for Tests | |
| runs-on: ubuntu-latest | |
| if: needs.changes.outputs.any == 'true' || github.event_name == 'workflow_dispatch' | |
| needs: [changes] | |
| steps: | |
| # Wait for tests workflow to complete before building docs | |
| # Note: This step requires GitHub API access and won't work with act (local testing) | |
| # It will fail gracefully in act, allowing manual testing of docs build steps | |
| - name: Wait for Tests Workflow | |
| uses: lewagon/[email protected] | |
| continue-on-error: true | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha || github.sha }} | |
| check-name: Run All Tests | |
| repo-token: ${{ secrets.GITHUB_TOKEN }} | |
| wait-interval: ${{ env.WAIT_INTERVAL_SECONDS }} | |
| allowed-conclusions: success | |
| build: | |
| name: Build | |
| runs-on: ubuntu-latest | |
| needs: [changes, wait] | |
| if: needs.changes.outputs.any == 'true' || github.event_name == 'workflow_dispatch' | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Python | |
| uses: ./.github/actions/setup-python | |
| with: | |
| python-version: ${{ env.PYTHON_VERSION }} | |
| enable-cache: true | |
| - name: Install Dependencies | |
| run: | | |
| echo "Installing documentation dependencies..." | |
| uv sync --group docs --no-dev | |
| # Download coverage from tests workflow (requires GitHub API) | |
| # Note: This step requires GitHub API access and won't work with act (local testing) | |
| # For local testing with act, coverage will need to be generated manually or skipped | |
| - name: Download Coverage from Tests Workflow | |
| uses: dawidd6/action-download-artifact@v11 | |
| continue-on-error: true | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| workflow: tests.yml | |
| name: coverage-html | |
| path: htmlcov | |
| if_no_artifact_found: ignore | |
| search_artifacts: true | |
| allow_forks: false | |
| repo: ${{ github.repository }} | |
| commit: ${{ github.event.pull_request.head.sha || github.sha }} | |
| # Prepare coverage for MkDocs | |
| # Note: In act (local testing), this may fail if coverage isn't available | |
| # Coverage must be generated manually or the mkdocs-coverage plugin will be skipped | |
| - name: Prepare Coverage for MkDocs | |
| run: ./.github/scripts/docs.sh prepare-coverage || echo "Coverage not available, | |
| building docs without coverage reports" | |
| - name: Build MkDocs Documentation | |
| working-directory: docs | |
| run: | | |
| echo "Building MkDocs documentation..." | |
| uv run mkdocs build | |
| echo "Documentation build completed successfully" | |
| - name: Upload Documentation Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: docs | |
| path: docs/site | |
| retention-days: ${{ env.ARTIFACT_RETENTION_DAYS }} | |
| if-no-files-found: warn | |
| deploy: | |
| name: Deploy | |
| runs-on: ubuntu-latest | |
| needs: [build] | |
| if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, | |
| 'refs/heads/v')) | |
| permissions: | |
| contents: read | |
| deployments: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Download Documentation Artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: docs | |
| path: docs/site | |
| # Deploy to Cloudflare (requires Cloudflare API) | |
| # Note: These steps require Cloudflare API access and won't work with act (local testing) | |
| # They will fail gracefully in act, allowing manual testing of docs build steps | |
| - name: Deploy to Production | |
| if: github.ref == 'refs/heads/main' | |
| uses: cloudflare/wrangler-action@v3 | |
| continue-on-error: true | |
| with: | |
| apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
| workingDirectory: docs | |
| command: deploy --env production | |
| - name: Upload Preview Version | |
| if: github.ref != 'refs/heads/main' | |
| uses: cloudflare/wrangler-action@v3 | |
| continue-on-error: true | |
| with: | |
| apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
| workingDirectory: docs | |
| command: versions upload --env preview |