opencode/.github/workflows/check-docs.yml
Adam 2bbd78a5ba
ci(site): build the docs in both modes
dev.opencode.ai renders the docs restyle and opencode.ai the legacy docs
until the flip (src/docs/AGENTS.md, "Restyle"), so check-docs builds
both modes.
2026-11-06 15:14:37 -06:00

47 lines
1.6 KiB
YAML

name: check-docs
# Builds the V2 docs on their own (services/site/src/docs/script/build.ts), in both modes: compiles every MDX page,
# prerenders it, builds search, checks every link and that pages load nothing from outside /docs. The
# site's deploy runs the same step, so a broken page fails here instead of blocking the deploy.
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
paths:
- services/site/**
- packages/protocol/openapi.json
- packages/cli/src/config/**
- .github/workflows/check-docs.yml
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
docs:
name: docs build
if: ${{ !github.event.pull_request.draft }}
runs-on: blacksmith-4vcpu-ubuntu-2404
timeout-minutes: 10
defaults:
run:
working-directory: services/site
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- uses: ./.github/actions/setup-bun
# The API reference and the config schema the pages link (/docs/openapi.json, /v2/cli.json).
- name: Generate
run: bun run generate
# dev.opencode.ai renders the restyle and opencode.ai the legacy docs until the flip
# (src/docs/AGENTS.md, "Restyle"), so both must build.
- name: Build docs (dev)
run: bun src/docs/script/build.ts --mode dev --out "$RUNNER_TEMP/docs-dev"
- name: Build docs (production)
run: bun src/docs/script/build.ts --mode production --out "$RUNNER_TEMP/docs-production"