1
+ name : Deploy MkDocs to GitHub Pages
2
+
3
+ on :
4
+ push :
5
+ branches :
6
+ - main
7
+ - master
8
+ paths :
9
+ - ' docs/**'
10
+ - ' mkdocs.yml'
11
+ - ' pyproject.toml'
12
+ - ' .github/workflows/docs.yml'
13
+ workflow_dispatch : # Allow manual triggering
14
+
15
+ permissions :
16
+ contents : read
17
+ pages : write
18
+ id-token : write
19
+
20
+ # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
21
+ # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
22
+ concurrency :
23
+ group : " pages"
24
+ cancel-in-progress : false
25
+
26
+ jobs :
27
+ build :
28
+ runs-on : ubuntu-latest
29
+ steps :
30
+ - name : Checkout
31
+ uses : actions/checkout@v4
32
+
33
+ - name : Set up Python
34
+ uses : actions/setup-python@v5
35
+ with :
36
+ python-version : ' 3.11'
37
+
38
+ - name : Install Poetry
39
+ uses : snok/install-poetry@v1
40
+ with :
41
+ version : latest
42
+ virtualenvs-create : true
43
+ virtualenvs-in-project : true
44
+
45
+ - name : Load cached venv
46
+ id : cached-poetry-dependencies
47
+ uses : actions/cache@v4
48
+ with :
49
+ path : .venv
50
+ key : venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
51
+
52
+ - name : Install dependencies
53
+ if : steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
54
+ run : poetry install --no-interaction --no-root
55
+
56
+ - name : Install project
57
+ run : poetry install --no-interaction
58
+
59
+ - name : Build MkDocs
60
+ run : poetry run mkdocs build
61
+
62
+ - name : Setup Pages
63
+ uses : actions/configure-pages@v5
64
+
65
+ - name : Upload artifact
66
+ uses : actions/upload-pages-artifact@v3
67
+ with :
68
+ path : ./site
69
+
70
+ deploy :
71
+ environment :
72
+ name : github-pages
73
+ url : ${{ steps.deployment.outputs.page_url }}
74
+ runs-on : ubuntu-latest
75
+ needs : build
76
+ steps :
77
+ - name : Deploy to GitHub Pages
78
+ id : deployment
79
+ uses : actions/deploy-pages@v4
0 commit comments