-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (38 loc) · 1.21 KB
/
mkdocs-deploy.yaml
File metadata and controls
41 lines (38 loc) · 1.21 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
name: Deploy MkDocs Site to GitHub Pages
on:
push:
branches:
- mkdocs
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Configure Git Credentials
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
- uses: actions/setup-python@v4
with:
python-version: 3.x
- uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
# - name: Sync README.md
# run: |
# cp docs/index.md README.md
# git config --local user.email "action@github.com"
# git config --local user.name "GitHub Action"
# if ! git diff --quiet README.md; then
# git add README.md
# git commit -m "Sync README.md with docs/index.md"
# git push
# fi
- run: pip install -r requirements.txt
- name: Remove test directory # 删除test目录
run: rm -rf docs/test
- run: mkdocs gh-deploy --force