-
Notifications
You must be signed in to change notification settings - Fork 4
69 lines (54 loc) · 2.33 KB
/
ci-basic-mkdocs.yml
File metadata and controls
69 lines (54 loc) · 2.33 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
60
61
62
63
64
65
66
67
68
69
# ============================================================
# .github/workflows/ci-basic-mkdocs.yml (Continuous Integration)
# ============================================================
# SOURCE: https://github.com/denisecase/templates
#
# WHY-FILE: Validate repository hygiene and documentation builds.
# REQ: Any check that can be run locally MUST be available locally via pre-commit.
# REQ: CI MUST NOT introduce arbitrary rules that are not reproducible locally.
# OBS: CI validates only; it never edits files or deploys docs.
name: CI Basic (MkDocs Site)
# WHY: Validate docs and repo metadata on PRs and pushes.
# OBS: This workflow validates only; it never deploys.
on:
push:
branches: [main] # WHY: Run when pushing to main branch.
pull_request:
branches: [main] # WHY: Run on pull requests targeting main branch.
workflow_dispatch: # WHY: Allow manual triggering from Actions tab.
permissions: # WHY: Use least privileges required.
contents: read
env:
PYTHONUNBUFFERED: "1" # WHY: Real-time logging.
PYTHONIOENCODING: "utf-8" # WHY: Ensure UTF-8 encoding for international characters.
jobs:
ci:
name: CI
runs-on: ubuntu-latest # WHY: Linux environment matches most production deployments
timeout-minutes: 30 # WHY: Prevent hanging jobs. If over, it is likely stuck.
steps:
# ============================================================
# ASSEMBLE: Get code and set up environment
# ============================================================
- name: A1) Checkout repository code
# WHY: Needed to access files for checks.
uses: actions/checkout@v6
- name: A2) Install uv (with caching)
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: A3) Install Python version 3.14
run: uv python install 3.14
- name: A4) Sync to install dependencies
run: uv sync --extra dev --extra docs --upgrade
# === BASELINE CHECKS ===
- name: B1) Validate pyproject
run: uvx validate-pyproject
# === DEPLOY (SANITY CHECKS ONLY; NO DEPLOY) ===
- name: D1) Build docs (mkdocs --strict)
run: |
if [ -f "mkdocs.yml" ] || [ -f "mkdocs.yaml" ]; then
uv run mkdocs build --strict
else
echo "No mkdocs config found; skipping docs build."
fi