-
Notifications
You must be signed in to change notification settings - Fork 25
59 lines (54 loc) · 1.81 KB
/
Copy pathdocs.yml
File metadata and controls
59 lines (54 loc) · 1.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: Docs
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
permissions:
contents: read
concurrency:
group: docs-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
PYTHON_VERSION: "3.12"
UV_VERSION: "0.10.9"
UV_NO_MANAGED_PYTHON: "1"
NO_MKDOCS_2_WARNING: "1"
jobs:
build:
name: Strict Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
persist-credentials: false
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: ${{ env.PYTHON_VERSION }}
- uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with:
version: ${{ env.UV_VERSION }}
enable-cache: true
- name: Install locked documentation environment
run: uv sync --locked --dev --extra docs
- name: Record source identity
run: |
echo "ML4T_DOCS_VERSION=$(uv run python -c 'from ml4t.data import __version__; print(__version__)')" >> "$GITHUB_ENV"
echo "ML4T_DOCS_COMMIT=${GITHUB_SHA}" >> "$GITHUB_ENV"
- name: Build documentation strictly
run: uv run mkdocs build --strict
- name: Verify rendered identity
run: >-
uv run python scripts/verify_documentation_identity.py
--site site
--expected-library data
--expected-version "$ML4T_DOCS_VERSION"
--expected-commit "$ML4T_DOCS_COMMIT"
- name: Upload rendered documentation
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: docs-site-${{ github.sha }}
path: site/
if-no-files-found: error