Skip to content

Commit d08cd03

Browse files
committed
ci: add mutli version support
1 parent c4f7cf0 commit d08cd03

File tree

2 files changed

+36
-3
lines changed

2 files changed

+36
-3
lines changed
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: ci
1+
name: Build/Publish Develop Docs
22
on:
33
push:
44
branches:
@@ -25,5 +25,7 @@ jobs:
2525
path: .cache
2626
restore-keys: |
2727
mkdocs-material-
28-
- run: pip install mkdocs-material jieba mkdocs-git-revision-date-localized-plugin mkdocs-git-committers-plugin-2
29-
- run: mkdocs gh-deploy --force
28+
- run: pip install mike mkdocs-material jieba mkdocs-git-revision-date-localized-plugin mkdocs-git-committers-plugin-2 mkdocs-static-i18n
29+
- run: |
30+
git fetch origin gh-pages --depth=1
31+
mike deploy --push --update-aliases main latest
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Build/Publish Release Docs
2+
on:
3+
push:
4+
tags:
5+
- v*
6+
7+
permissions:
8+
contents: write
9+
jobs:
10+
deploy:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- name: Configure Git Credentials
15+
run: |
16+
git config user.name github-actions[bot]
17+
git config user.email github-actions[bot]@users.noreply.github.com
18+
- uses: actions/setup-python@v5
19+
with:
20+
python-version: 3.x
21+
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
22+
- uses: actions/cache@v4
23+
with:
24+
key: mkdocs-material-${{ env.cache_id }}
25+
path: .cache
26+
restore-keys: |
27+
mkdocs-material-
28+
- run: pip install mike mkdocs-material jieba mkdocs-git-revision-date-localized-plugin mkdocs-git-committers-plugin-2 mkdocs-static-i18n
29+
- run: |
30+
git fetch origin gh-pages --depth=1
31+
mike deploy --push "${{ github.ref_name }}"

0 commit comments

Comments
 (0)