-
Notifications
You must be signed in to change notification settings - Fork 15
76 lines (64 loc) · 2.01 KB
/
deploy-mkdocs.yml
File metadata and controls
76 lines (64 loc) · 2.01 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
# SPDX-FileCopyrightText: Copyright Corsinvest Srl
# SPDX-License-Identifier: MIT
name: Deploy MkDocs Documentation
on:
push:
branches:
- master
paths:
- 'doc/markdown/**'
- 'doc/mkdocs/**'
- '.github/workflows/deploy-mkdocs.yml'
workflow_dispatch:
# Allow manual trigger
permissions:
contents: write
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for git info
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Cache pip packages
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install MkDocs and dependencies
run: |
pip install mkdocs-material
- name: Install PowerShell dependencies
shell: pwsh
run: |
Install-Module -Name platyPS -Force -Scope CurrentUser -SkipPublisherCheck
- name: Generate MkDocs documentation
shell: pwsh
run: |
Import-Module ./Tools.psm1 -Force
Invoke-PveAction -Action 'create-doc-mkdocs'
- name: Copy files for MkDocs (symlinks don't work in CI)
run: |
cp -r doc/markdown doc/mkdocs/docs/
cp README.md doc/mkdocs/docs/index.md
cp LICENSE doc/mkdocs/docs/LICENSE
- name: Build MkDocs site
run: |
cd doc/mkdocs
mkdocs build --strict
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./doc/_site
publish_branch: gh-pages
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
commit_message: 'docs: deploy MkDocs documentation'