132 lines
3.3 KiB
YAML
132 lines
3.3 KiB
YAML
name: Deploy Documentation
|
|
|
|
on:
|
|
push:
|
|
branches: [ main ]
|
|
paths:
|
|
- 'docs/**'
|
|
- 'examples/**'
|
|
- 'scripts/inference/**'
|
|
- 'docs-site/**'
|
|
- 'fastvideo/**'
|
|
- 'README.md'
|
|
- 'requirements-docs.in'
|
|
- 'requirements-docs.txt'
|
|
- 'scripts/check_docs_links.py'
|
|
- '.github/workflows/infra-docs.yml'
|
|
pull_request:
|
|
branches: [ main ]
|
|
paths:
|
|
- 'docs/**'
|
|
- 'examples/**'
|
|
- 'scripts/inference/**'
|
|
- 'docs-site/**'
|
|
- 'fastvideo/**'
|
|
- 'README.md'
|
|
- 'requirements-docs.in'
|
|
- 'requirements-docs.txt'
|
|
- 'scripts/check_docs_links.py'
|
|
- '.github/workflows/infra-docs.yml'
|
|
|
|
permissions:
|
|
contents: read
|
|
pages: write
|
|
id-token: write
|
|
|
|
concurrency:
|
|
group: "pages"
|
|
cancel-in-progress: false
|
|
|
|
jobs:
|
|
build:
|
|
timeout-minutes: 15
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Setup Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: '3.12'
|
|
|
|
- name: Install uv
|
|
uses: astral-sh/setup-uv@v3
|
|
|
|
- name: Install dependencies
|
|
run: uv pip install --system -r requirements-docs.txt
|
|
|
|
- name: Setup Pages
|
|
uses: actions/configure-pages@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '24'
|
|
cache: npm
|
|
cache-dependency-path: |
|
|
docs/package-lock.json
|
|
docs-site/package-lock.json
|
|
|
|
- name: Install cookbook dependencies
|
|
run: |
|
|
npm ci --prefix docs
|
|
npm ci --prefix docs-site
|
|
|
|
- name: Validate and generate cookbook catalogs
|
|
run: |
|
|
npm run check:cookbook --prefix docs
|
|
npm run test:cookbook --prefix docs
|
|
python docs/tests/test_cookbook_assets.py
|
|
npm run build:catalog --prefix docs
|
|
|
|
- name: Check site types and formatting
|
|
run: |
|
|
npm run check --prefix docs-site
|
|
npm run format:check --prefix docs-site
|
|
|
|
- name: Build and validate documentation
|
|
run: |
|
|
npm run build --prefix docs-site
|
|
npm run validate --prefix docs-site
|
|
npm run test:content --prefix docs-site
|
|
python -m unittest discover -s docs-site/tests -p 'test_*.py'
|
|
python docs/check_cookbook_assets.py docs-site/dist
|
|
|
|
- name: Install test browser
|
|
working-directory: docs-site
|
|
run: npx playwright install --with-deps chromium
|
|
|
|
- name: Test documentation and cookbook interactions
|
|
run: npm test --prefix docs-site
|
|
|
|
- name: Check docs links
|
|
run: python scripts/check_docs_links.py
|
|
|
|
- name: Upload artifact
|
|
uses: actions/upload-pages-artifact@v3
|
|
with:
|
|
path: ./docs-site/dist
|
|
|
|
- name: Upload browser failure traces
|
|
if: failure()
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: docs-browser-results
|
|
path: docs-site/test-results
|
|
if-no-files-found: ignore
|
|
|
|
deploy:
|
|
environment:
|
|
name: github-pages
|
|
url: ${{ steps.deployment.outputs.page_url }}
|
|
runs-on: ubuntu-latest
|
|
needs: build
|
|
if: github.ref == 'refs/heads/main'
|
|
steps:
|
|
- name: Deploy to GitHub Pages
|
|
id: deployment
|
|
uses: actions/deploy-pages@v4
|