generated from yanyongyu/python-poetry-template
-
-
Notifications
You must be signed in to change notification settings - Fork 27
63 lines (53 loc) · 1.4 KB
/
docs.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: Docs CI/CD
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Poetry
uses: ./.github/actions/setup-poetry
- name: Setup Python environment
uses: ./.github/actions/setup-python
with:
env-dir: .
args: "--with docs"
- uses: actions/cache@v4
with:
key: mkdocs-material-${{ hashfiles('.cache/**') }}
path: .cache
restore-keys: |
mkdocs-material-
- name: Build Docs
run: |
poetry run mkdocs --version
poetry run mkdocs build --clean
chmod -c -R +rX "site/" | while read line; do
echo "::warning title=Invalid file permissions automatically fixed::$line"
done
env:
MKDOCS_GIT_COMMITTERS_APIKEY: ${{ secrets.GITHUB_TOKEN }}
- name: Upload to GitHub Pages
uses: actions/upload-pages-artifact@v3
with:
path: site
deploy:
runs-on: ubuntu-latest
needs: build
permissions:
id-token: write
pages: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4