File tree Expand file tree Collapse file tree 4 files changed +100
-6
lines changed Expand file tree Collapse file tree 4 files changed +100
-6
lines changed Original file line number Diff line number Diff line change
1
+ name : Test Documentation Build and Deploy
2
+
3
+ on :
4
+ push :
5
+ branches-ignore :
6
+ - master
7
+ - main
8
+ pull_request :
9
+ branches :
10
+ - " *"
11
+
12
+ jobs :
13
+ test-deploy :
14
+ runs-on : ubuntu-latest
15
+ steps :
16
+ - uses : actions/checkout@v4
17
+ with :
18
+ fetch-depth : 0
19
+
20
+ - name : Configure Git Credentials
21
+ run : |
22
+ git config user.name github-actions[bot]
23
+ git config user.email 41898282+github-actions[bot]@users.noreply.github.com
24
+
25
+ - uses : actions/setup-python@v5
26
+ with :
27
+ python-version : " 3.10"
28
+
29
+ - run : echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
30
+
31
+ - uses : actions/cache@v4
32
+ with :
33
+ key : mkdocs-material-${{ env.cache_id }}
34
+ path : .cache
35
+ restore-keys : |
36
+ mkdocs-material-
37
+
38
+ - name : Install dependencies and Deploy
39
+ run : |
40
+ python -m pip install --upgrade pip
41
+ pip install -r requirements-dev.lock
42
+
43
+ - name : Test documentation build
44
+ run : mkdocs build
45
+
46
+ - name : Test full deployment process
47
+ run : |
48
+ # Simulate tag deployment
49
+ mike deploy test-version latest --allow-empty
50
+
51
+ # Simulate dev deployment
52
+ mike deploy dev --allow-empty
53
+
54
+ # Check the current state
55
+ git status
56
+ git log --oneline -n 5
57
+
58
+ - name : Cleanup
59
+ run : |
60
+ git checkout ${{ github.ref }}
61
+ git branch -D gh-pages
Original file line number Diff line number Diff line change 4
4
branches :
5
5
- master
6
6
- main
7
+ tags :
8
+ - " v*.*.*"
9
+
7
10
permissions :
8
11
contents : write
12
+
9
13
jobs :
10
14
deploy :
11
15
runs-on : ubuntu-latest
12
16
steps :
13
17
- uses : actions/checkout@v4
18
+ with :
19
+ fetch-depth : 0
20
+
14
21
- name : Configure Git Credentials
15
22
run : |
16
23
git config user.name github-actions[bot]
17
24
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
25
+
18
26
- uses : actions/setup-python@v5
19
27
with :
20
28
python-version : " 3.10"
29
+
21
30
- run : echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
31
+
22
32
- uses : actions/cache@v4
23
33
with :
24
34
key : mkdocs-material-${{ env.cache_id }}
25
35
path : .cache
26
36
restore-keys : |
27
37
mkdocs-material-
38
+
28
39
- name : Install dependencies and Deploy
29
40
run : |
30
41
python -m pip install --upgrade pip
31
42
pip install -r requirements-dev.lock
32
- - name : Fetch gh-pages branch
33
- run : |
34
- git fetch origin gh-pages:gh-pages
35
43
36
- - name : Deploy HTML files
37
- run : mkdocs gh-deploy --force
44
+ # - name: Fetch gh-pages branch
45
+ # run: |
46
+ # git fetch origin gh-pages:gh-pages
47
+
48
+ # - name: Deploy HTML files
49
+ # run: mkdocs gh-deploy --force
50
+
51
+ - name : Deploy documentation
52
+ run : |
53
+ if [[ ${{ github.ref }} =~ ^refs/tags/ ]]; then
54
+ # push tag
55
+ VERSION=${GITHUB_REF#refs/tags/}
56
+ mike deploy --push --update-aliases $VERSION latest
57
+ mike set-default --push latest
58
+ else
59
+ # push to main/master branch
60
+ mike deploy --push --update-aliases dev
61
+ fi
Original file line number Diff line number Diff line change @@ -84,6 +84,15 @@ plugins:
84
84
show_inheritance_diagram : true
85
85
heading_level : 3
86
86
show_root_toc_entry : false
87
+ - mike :
88
+ # These fields are all optional; the defaults are as below...
89
+ alias_type : symlink
90
+ redirect_template : null
91
+ deploy_prefix : ' '
92
+ canonical_version : null
93
+ version_selector : true
94
+ css_dir : css
95
+ javascript_dir : js
87
96
88
97
watch :
89
98
- src
Original file line number Diff line number Diff line change @@ -203,5 +203,5 @@ dev-dependencies = [
203
203
" mkdocs-mermaid2-plugin>=1.1.1" ,
204
204
" ruff>=0.5.5" ,
205
205
" jsonschema-markdown>=0.3.8" ,
206
- " mike>=2.1.1 " ,
206
+ " mike>=2.1.3 " ,
207
207
]
You can’t perform that action at this time.
0 commit comments