Skip to content

fix(server): return Codex metadata from /v1/models #453

fix(server): return Codex metadata from /v1/models

fix(server): return Codex metadata from /v1/models #453

Workflow file for this run

name: Documentation
on:
pull_request:
paths:
- "docs/**"
- "mkdocs_hooks.py"
- "mkdocs.yml"
- "pyproject.toml"
- "uv.lock"
- "Cargo.toml"
- "Cargo.lock"
- "rust-toolchain.toml"
- "crates/libsy/**"
- "crates/protocol/**"
- ".github/workflows/docs.yml"
push:
branches: [main]
paths:
- "docs/**"
- "mkdocs_hooks.py"
- "mkdocs.yml"
- "pyproject.toml"
- "uv.lock"
- "Cargo.toml"
- "Cargo.lock"
- "rust-toolchain.toml"
- "crates/libsy/**"
- "crates/protocol/**"
- ".github/workflows/docs.yml"
# Cancel superseded PR runs; keep main builds so gh-pages writes don't race.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
env:
MKDOCS_SOURCE_REF: ${{ github.event.pull_request.head.sha || github.sha }}
permissions:
contents: read
jobs:
build:
name: Build docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v6
with:
python-version: "3.12"
enable-cache: true
cache-dependency-glob: "uv.lock"
- run: uv sync --only-group docs --locked
- name: Build documentation
run: uv run --only-group docs mkdocs build --strict
- name: Build Rust crate documentation
env:
RUSTDOCFLAGS: -D warnings
run: >-
cargo doc --locked --no-deps
--package switchyard-libsy
--package switchyard-protocol
- name: Add crate documentation to site
run: |
mkdir -p site/rust
cp -R target/doc/. site/rust/
- name: Upload site artifact
uses: actions/upload-artifact@v4
with:
name: docs-site
path: site/
retention-days: 1
deploy:
name: Deploy to GitHub Pages
needs: build
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Download site artifact
uses: actions/download-artifact@v4
with:
name: docs-site
path: site/
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./site
keep_files: true
# Fork PRs can't write to gh-pages with GITHUB_TOKEN, so the preview is
# gated to same-repo PRs.
preview:
name: Deploy PR preview
needs: build
if: >-
github.event_name == 'pull_request' &&
github.event.pull_request.head.repo.full_name == github.repository
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
- name: Download site artifact
uses: actions/download-artifact@v4
with:
name: docs-site
path: site/
- name: Deploy PR preview
uses: rossjrw/pr-preview-action@v1
with:
source-dir: ./site
preview-branch: gh-pages
umbrella-dir: pr-preview
action: auto
qr-code: false