-
Notifications
You must be signed in to change notification settings - Fork 1
131 lines (112 loc) · 3.62 KB
/
Copy pathdocs-github-pages-publish.yml
File metadata and controls
131 lines (112 loc) · 3.62 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
name: Docs GitHub Pages Publish
on:
push:
branches:
- main
- master
paths:
- "docs/**"
- "mkdocs.yml"
- "docs/requirements-mkdocs.txt"
- "scripts/run-mkdocs.js"
- "package.json"
- "package-lock.json"
- "README.md"
- ".github/workflows/docs-github-pages-publish.yml"
workflow_dispatch:
inputs:
git_ref:
description: "Branch, tag, or commit to publish from (rollback)"
required: false
type: string
site_url:
description: "MkDocs site_url override"
required: false
default: "https://jacobinwwey.github.io/NoteConnection/"
type: string
base_path:
description: "MkDocs base path override"
required: false
default: "/NoteConnection/"
type: string
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: docs-github-pages
cancel-in-progress: false
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
jobs:
verify-diataxis-map:
name: verify-diataxis-map
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v5
with:
ref: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.git_ref != '' && github.event.inputs.git_ref || github.ref }}
lfs: false
- name: Setup Node.js
uses: actions/setup-node@v5
with:
node-version: "20"
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Verify Diataxis mapping governance
run: npm run docs:diataxis:check
build-site:
name: build-site
runs-on: ubuntu-latest
needs: verify-diataxis-map
steps:
- name: Checkout repository
uses: actions/checkout@v5
with:
ref: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.git_ref != '' && github.event.inputs.git_ref || github.ref }}
lfs: false
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: "3.12"
cache: "pip"
cache-dependency-path: docs/requirements-mkdocs.txt
- name: Install MkDocs dependencies
run: pip install -r docs/requirements-mkdocs.txt
- name: Resolve MkDocs runtime URL config
shell: bash
run: |
SITE_URL="${{ github.event_name == 'workflow_dispatch' && github.event.inputs.site_url || '' }}"
BASE_PATH="${{ github.event_name == 'workflow_dispatch' && github.event.inputs.base_path || '' }}"
if [ -z "${SITE_URL}" ]; then
SITE_URL="https://jacobinwwey.github.io/NoteConnection/"
fi
if [ -z "${BASE_PATH}" ]; then
BASE_PATH="/NoteConnection/"
fi
echo "MKDOCS_SITE_URL=${SITE_URL}" >> "$GITHUB_ENV"
echo "MKDOCS_BASE_PATH=${BASE_PATH}" >> "$GITHUB_ENV"
echo "MKDOCS_DOCS_HOST=https://jacobinwwey.github.io/" >> "$GITHUB_ENV"
echo "site_url=${SITE_URL}" >> "$GITHUB_OUTPUT"
echo "base_path=${BASE_PATH}" >> "$GITHUB_OUTPUT"
- name: Build docs site
run: mkdocs build --config-file mkdocs.yml
- name: Setup GitHub Pages
uses: actions/configure-pages@v5
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v4
with:
path: build/mkdocs-site
deploy-site:
name: deploy-site
runs-on: ubuntu-latest
needs: build-site
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4