docs: fail docs build on warnings (#3707)

## Summary

- run the existing MkDocs deployment build in strict mode
- turn documentation warnings, including unresolved references, into CI
failures instead of deploying them

## Why

The docs workflow currently completes when MkDocs emits warnings. Using
MkDocs' built-in strict mode makes the deployment stop on those warnings
and surfaces documentation problems immediately. This addresses the
warning-detection portion of #572 without adding another dependency or
duplicating the docs build.

## Validation

- `git diff --check`
- parsed `.github/workflows/docs.yml` with PyYAML
- full `mkdocs build --strict` was not run locally because MkDocs is not
installed; the existing docs workflow has the required dependencies

---------

Co-authored-by: Will Jones <willjones127@gmail.com>
Co-authored-by: Xuanwo <github@xuanwo.io>
This commit is contained in:
Sushanth012
2026-12-02 02:03:26 +08:00
committed by GitHub
co-authored by Will Jones Xuanwo
parent a0ff67e13e
commit 193c9d8e2e
15 changed files with 75 additions and 41 deletions
+22 -9
View File
@@ -4,18 +4,23 @@ on:
push:
branches: ["main"]
# Validate the SDK reference on PRs that touch the docs or their Python sources.
pull_request:
paths:
- .github/workflows/docs.yml
- docs/**
- python/python/**
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
# The build executes checked-out code, so keep its token read-only.
permissions:
contents: read
pages: write
id-token: write
# Allow one concurrent deployment
# Serialize deployments and give each PR its own concurrency group.
concurrency:
group: "pages"
group: ${{ github.event_name == 'pull_request' && format('pages-pr-{0}', github.event.pull_request.number) || 'pages' }}
cancel-in-progress: true
env:
@@ -34,6 +39,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v6
with:
persist-credentials: false
- name: Install dependencies needed for ubuntu
run: |
sudo apt update
@@ -63,13 +70,13 @@ jobs:
- name: Build docs
working-directory: docs
run: |
PYTHONPATH=. mkdocs build
- name: Setup Pages
uses: actions/configure-pages@v5
PYTHONPATH=. mkdocs build --strict
- name: Set artifact name
if: github.event_name != 'pull_request'
id: artifact-name
run: echo "name=github-pages-${{ github.run_id }}-${{ github.run_attempt }}" >> "$GITHUB_OUTPUT"
- name: Upload artifact
if: github.event_name != 'pull_request'
uses: actions/upload-pages-artifact@v3
with:
name: ${{ steps.artifact-name.outputs.name }}
@@ -81,11 +88,17 @@ jobs:
deploy:
name: Deploy to GitHub Pages
needs: build
runs-on: ubuntu-24.04
if: github.event_name != 'pull_request'
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-24.04
steps:
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4