Skip to content

Commit 752e013

Browse files
committed
Add versioning
1 parent 9e10084 commit 752e013

File tree

3 files changed

+36
-3
lines changed

3 files changed

+36
-3
lines changed

.github/workflows/build.yml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,48 @@ on:
33
push:
44
branches:
55
- doc
6+
67
permissions:
78
contents: write
89
jobs:
910
deploy:
1011
runs-on: ubuntu-latest
1112
steps:
13+
- name: Checkout main branch
14+
uses: actions/checkout@v4
15+
with:
16+
ref: main
17+
fetch-depth: 0
18+
fetch-tags: true
19+
20+
- name: Get latest tag
21+
id: get-latest-tag
22+
run: |
23+
echo "TAG_NAME=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
24+
1225
- uses: actions/checkout@v4
26+
with:
27+
ref: doc
28+
fetch-depth: 0
29+
fetch-tags: true
30+
1331
- name: Configure Git Credentials
1432
run: |
1533
git config user.name github-actions[bot]
1634
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
35+
1736
- uses: actions/setup-python@v5
1837
with:
1938
python-version: 3.x
2039
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
40+
2141
- uses: actions/cache@v4
2242
with:
2343
key: mkdocs-material-${{ env.cache_id }}
2444
path: .cache
2545
restore-keys: |
2646
mkdocs-material-
2747
- run: pip install -r requirements.txt
28-
- run: mkdocs gh-deploy --force
48+
# - run: mkdocs gh-deploy --force
49+
# - run: mike delete latest
50+
- run: mike deploy --push ${{ env.TAG_NAME }}

mkdocs.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ theme:
1313
palette:
1414
- primary: custom
1515

16+
extra:
17+
version:
18+
provider: mike
19+
1620
extra_css:
1721
- stylesheets/extra.css
1822

@@ -28,4 +32,10 @@ plugins:
2832
build: true
2933
- locale: en
3034
name: English
31-
build: true
35+
build: true
36+
- mike:
37+
alias_type: symlink
38+
redirect_template: null
39+
deploy_prefix: ''
40+
canonical_version: null
41+
version_selector: true

requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
mkdocs
22
mkdocs-material
3-
mkdocs-static-i18n
3+
mkdocs-static-i18n
4+
mike

0 commit comments

Comments
 (0)