Files
lancedb/.github/workflows/docs.yml
T
193c9d8e2e 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>
2026-12-02 02:03:26 +08:00

107 lines
3.6 KiB
YAML

name: Deploy docs to Pages
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:
# The build executes checked-out code, so keep its token read-only.
permissions:
contents: read
# Serialize deployments and give each PR its own concurrency group.
concurrency:
group: ${{ github.event_name == 'pull_request' && format('pages-pr-{0}', github.event.pull_request.number) || 'pages' }}
cancel-in-progress: true
env:
# This reduces the disk space needed for the build
RUSTFLAGS: "-C debuginfo=0"
# according to: https://matklad.github.io/2021/09/04/fast-rust-builds.html
# CI builds are faster with incremental disabled.
CARGO_INCREMENTAL: "0"
PIP_EXTRA_INDEX_URL: "https://pypi.fury.io/lance-format/ https://pypi.fury.io/lancedb/"
jobs:
build:
runs-on: ubuntu-24.04
outputs:
artifact_name: ${{ steps.artifact-name.outputs.name }}
steps:
- name: Checkout
uses: actions/checkout@v6
with:
persist-credentials: false
- name: Install dependencies needed for ubuntu
run: |
sudo apt update
sudo apt install -y protobuf-compiler libssl-dev
rustup update && rustup default
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.11"
cache: "pip"
cache-dependency-path: "docs/requirements.txt"
- uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
- name: Build Python
working-directory: python
run: |
python -m pip install --extra-index-url https://pypi.fury.io/lance-format/ --extra-index-url https://pypi.fury.io/lancedb/ -e .
python -m pip install --extra-index-url https://pypi.fury.io/lance-format/ --extra-index-url https://pypi.fury.io/lancedb/ -r ../docs/requirements.txt
- name: Set up node
uses: actions/setup-node@v6
with:
node-version: 24
- name: Install node dependencies
working-directory: nodejs
run: |
sudo apt update
sudo apt install -y protobuf-compiler libssl-dev
- name: Build docs
working-directory: docs
run: |
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 }}
path: "docs/site"
# Deploy from a separate job so the Pages artifact upload has settled before
# the deploy action looks it up. The per-run name keeps a full workflow
# re-run from accumulating artifacts that share the default name.
deploy:
name: Deploy to GitHub Pages
needs: build
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
with:
artifact_name: ${{ needs.build.outputs.artifact_name }}