-
Notifications
You must be signed in to change notification settings - Fork 14
77 lines (66 loc) · 2.02 KB
/
docs.yml
File metadata and controls
77 lines (66 loc) · 2.02 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
name: build-and-deploy-doc
# grant the job permission to push and deploy Pages
permissions:
contents: write
pages: write
id-token: write
on:
push:
branches:
- main
workflow_dispatch:
jobs:
mkdocs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install MkDocs toolchain
run: |
python -m pip install --upgrade pip
python -m pip install \
mkdocs \
mkdocs-material \
mkdocs-pdf-export-plugin \
mkdocs-git-revision-date-localized-plugin \
mkdocs-macros-plugin \
"mkdocs-with-pdf==0.9.3"
- name: Generate dynamic cover page
run: bash docs/scripts/generate_coverpage.sh
- name: Build site
run: python -m mkdocs build --clean
- name: Restore coverpage
run: git restore docs/coverpage.md
- name: Upload PDF artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: cinemate-docs-pdf
path: site/renders/*.pdf
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: gh-pages
publish_dir: ./site
user_name: github-actions[bot]
user_email: github-actions[bot]@users.noreply.github.com
allow_empty_commit: true
- name: Copy PDF to docs/renders and push
run: |
cp site/renders/Cinemate-Docs.pdf docs/renders/
git config user.name "CI"
git config user.email "ci@users.noreply.github.com"
git add docs/renders/Cinemate-Docs.pdf
if ! git diff --cached --quiet; then
git commit -m "CI: update rendered PDF"
git push
else
echo "PDF unchanged, skipping commit"
fi