1
+ name : Build Docs
2
+
1
3
on :
2
4
push :
3
5
branches :
4
6
- main
5
- permissions :
6
- contents : write
7
+
7
8
jobs :
8
- deploy :
9
- runs-on : ubuntu-latest
9
+ build :
10
+ strategy :
11
+ matrix :
12
+ python-version : [ 3.11 ]
13
+ os : [ ubuntu-latest ]
14
+ runs-on : ${{ matrix.os }}
10
15
steps :
11
- - uses : actions/checkout@v4
12
- - name : Configure Git Credentials
13
- run : |
14
- git config user.name github-actions[bot]
15
- git config user.email 41898282+github-actions[bot]@users.noreply.github.com
16
- - uses : actions/setup-python@v5
16
+ - name : Checkout code
17
+ uses : actions/checkout@v4
18
+
19
+ - name : Set up Python ${{ matrix.python-version }}
20
+ uses : actions/setup-python@v5
17
21
with :
18
- python-version : 3.x
19
- - run : echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
22
+ python-version : ${{ matrix.python-version }}
20
23
21
24
- name : Install dependencies
22
25
run : |
23
26
python -m pip install --upgrade pip
24
27
python -m pip install .
25
28
python -m pip install -r docs/requirements.txt
29
+
30
+ - name : Build docs
31
+ run : mkdocs build
26
32
27
- - uses : actions/cache@v4
33
+ - name : Upload docs
34
+ uses : actions/upload-pages-artifact@v3
28
35
with :
29
- key : mkdocs-material-${{ env.cache_id }}
30
- path : .cache
31
- restore-keys : |
32
- mkdocs-material-
33
- - run : pip install mkdocs-material
34
- - run : mkdocs gh-deploy --force
36
+ path : site
37
+
38
+ # Deploy job
39
+ deploy :
40
+ # Add a dependency to the build job
41
+ needs : build
42
+
43
+ # Grant GITHUB_TOKEN the permissions required to make a Pages deployment
44
+ permissions :
45
+ pages : write # to deploy to Pages
46
+ id-token : write # to verify the deployment originates from an appropriate source
47
+
48
+ # Deploy to the github-pages environment
49
+ environment :
50
+ name : github-pages
51
+ url : ${{ steps.deployment.outputs.page_url }}
52
+
53
+ # Specify runner + deployment step
54
+ runs-on : ubuntu-latest
55
+ steps :
56
+ - name : Deploy to GitHub Pages
57
+ id : deployment
58
+ uses : actions/deploy-pages@v4 # or specific "vX.X.X" version tag for this action
0 commit comments