File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Deploy MkDocs to GitHub Pages
2+
3+ on :
4+ push :
5+ branches : [ main ]
6+ workflow_dispatch : # Allows manual triggering
7+
8+ permissions :
9+ contents : read
10+ pages : write
11+ id-token : write
12+
13+ # Allow only one concurrent deployment
14+ concurrency :
15+ group : " pages"
16+ cancel-in-progress : false
17+
18+ jobs :
19+ build :
20+ runs-on : ubuntu-latest
21+ steps :
22+ - name : Checkout repository
23+ uses : actions/checkout@v4
24+ with :
25+ fetch-depth : 0 # Fetch full history for git info
26+
27+ - name : Setup Python
28+ uses : actions/setup-python@v5
29+ with :
30+ python-version : ' 3.x'
31+
32+ - name : Cache pip dependencies
33+ uses : actions/cache@v4
34+ with :
35+ path : ~/.cache/pip
36+ key : ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
37+ restore-keys : |
38+ ${{ runner.os }}-pip-
39+
40+ - name : Install MkDocs and dependencies
41+ run : |
42+ pip install --upgrade pip
43+ pip install mkdocs mkdocs-material
44+ # If you have a requirements.txt file:
45+ # pip install -r requirements.txt
46+
47+ - name : Build MkDocs site
48+ run : mkdocs build --clean
49+
50+ - name : Setup Pages
51+ uses : actions/configure-pages@v4
52+
53+ - name : Upload artifact
54+ uses : actions/upload-pages-artifact@v3
55+ with :
56+ path : ./site
57+
58+ deploy :
59+ environment :
60+ name : github-pages
61+ url : ${{ steps.deployment.outputs.page_url }}
62+ runs-on : ubuntu-latest
63+ needs : build
64+ steps :
65+ - name : Deploy to GitHub Pages
66+ id : deployment
67+ uses : actions/deploy-pages@v4
You can’t perform that action at this time.
0 commit comments