-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (75 loc) · 2.35 KB
/
Copy pathdocs.yml
File metadata and controls
85 lines (75 loc) · 2.35 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
name: Docs
on:
push:
branches: [main]
paths:
- "docs/**"
- "mkdocs.yml"
- "requirements-docs.txt"
- ".github/workflows/docs.yml"
- "assets/slmcode-logo.png"
pull_request:
branches: [main]
paths:
- "docs/**"
- "mkdocs.yml"
- "requirements-docs.txt"
- ".github/workflows/docs.yml"
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: true
jobs:
build:
name: Build MkDocs
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Set up Python
uses: actions/setup-python@v7
with:
python-version: "3.12"
cache: pip
cache-dependency-path: requirements-docs.txt
- name: Install docs deps
run: pip install -r requirements-docs.txt
- name: Sync logo into docs assets
run: |
mkdir -p docs/assets
cp -f assets/slmcode-logo.png docs/assets/slmcode-logo.png
- name: Build site
run: mkdocs build --strict
- name: Upload Pages artifact
if: github.event_name != 'pull_request'
# Pinned to the v3+v4 PAIR on purpose — see the deploy step below.
uses: actions/upload-pages-artifact@v3
with:
path: site
deploy:
name: Deploy GitHub Pages
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
# v4, NOT v5. The bump to upload-pages-artifact@v5 + deploy-pages@v5 in
# ff347b2 broke this deploy twice in a row: the artifact uploads and
# "Build MkDocs" passes, then v5 polls the Pages API, sees
# `updating_pages` for about a minute, reads one empty status and aborts
# with "Timeout reached". The same commit's CI and Vulnerability scan
# were green, and the identical workflow on v3+v4 succeeded on the
# commit immediately before (a217c63), so the pair is the variable.
#
# Re-open the bump when v5 has a fix; nothing else about the Actions
# sweep is reverted.
uses: actions/deploy-pages@v4