-
-
Notifications
You must be signed in to change notification settings - Fork 0
100 lines (90 loc) · 2.98 KB
/
docs.yml
File metadata and controls
100 lines (90 loc) · 2.98 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
---
name: docs
# Build and deploy the MkDocs site to GitHub Pages.
# * pull_request — build only (validates the docs render
# without publishing).
# * push to main — build + deploy to gh-pages.
# * workflow_dispatch — same as push (lets operators
# re-publish without a docs change).
#
# REPO SETUP REQUIRED — Settings → Pages → Source must be
# "GitHub Actions" (NOT "Deploy from a branch"). The
# branch-based default runs Jekyll on the main branch and
# fails because docs/ uses MkDocs's `{% include-markdown %}`
# syntax which Jekyll's `include` tag doesn't grok. The
# repo-root `.nojekyll` file is a defensive fallback that
# stops Jekyll from running even if the setting reverts.
on:
pull_request:
paths:
- "docs/**"
- "mkdocs.yml"
- "CHANGELOG.md"
- "cmd/hypercache-server/README.md"
- ".github/workflows/docs.yml"
push:
branches: [ main ]
paths:
- "docs/**"
- "mkdocs.yml"
- "CHANGELOG.md"
- "cmd/hypercache-server/README.md"
- ".github/workflows/docs.yml"
workflow_dispatch:
# Pages deployments require these permissions; the build-only
# branch (PR) doesn't actually use the deploy steps so the
# extra permissions are harmless.
permissions:
contents: read
pages: write
id-token: write
# A single in-flight deploy at a time. Newer pushes cancel
# older ones to avoid an out-of-order publish.
concurrency:
group: pages
cancel-in-progress: true
jobs:
build:
name: build
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0 # docs/ may reference files via relative paths
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: "3.13"
cache: pip
# `actions/setup-python` uses this file's hash as the
# pip-cache key. docs/requirements.txt pins the MkDocs
# + plugin versions so cache hits are reproducible and
# the runner can find a key file at all.
cache-dependency-path: docs/requirements.txt
- name: Install MkDocs + plugins
run: |
python -m pip install --upgrade pip
pip install -r docs/requirements.txt
- name: Build site (strict)
# Strict in CI catches broken links / missing pages on PR;
# `mkdocs serve` locally relaxes this for fast iteration.
run: mkdocs build --strict
- name: Upload Pages artifact
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
uses: actions/upload-pages-artifact@v5
with:
path: ./site
deploy:
name: deploy
needs: build
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
timeout-minutes: 5
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v5