-
Notifications
You must be signed in to change notification settings - Fork 51
45 lines (42 loc) · 1.12 KB
/
publish.yml
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
name: Publish
permissions:
contents: write
deployments: write
on:
workflow_dispatch:
push:
branches:
- main
jobs:
pages:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4.1.1
with:
fetch-depth: 0
- name: Setup Python
uses: actions/setup-python@v5.2.0
with:
python-version: '3.12'
- name: Setup Dependencies
run: pip install -r requirements.txt
- name: Build
shell: pwsh
run: |-
python -m mkdocs build
python -m mkdocs build --no-directory-urls --site-dir site_
foreach ($file in Get-ChildItem site_ -Recurse -File) {
$rp = Resolve-Path -Relative $file -RelativeBasePath site_
$match_path = Join-Path "./site" $rp
if (!(Test-Path $match_path)) {
Copy-Item $file $match_path
}
}
- name: Publish
run: |-
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
ghp-import site --push
- uses: actions/upload-artifact@v4.4.0
with:
path: './site'