Skip to content

Commit ec45aee

Browse files
authored
chore: configure main and latest versions to docs (#683)
1 parent 25067ec commit ec45aee

3 files changed

Lines changed: 16 additions & 8 deletions

File tree

.github/workflows/docs.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,13 @@ jobs:
3939
name: mkdocs-site
4040
path: site
4141
retention-days: 7
42-
- name: Deploy to pages
43-
if: ${{ github.ref_name == 'main' || github.event_name == 'release'}}
44-
uses: JamesIves/github-pages-deploy-action@d92aa235d04922e8f08b40ce78cc5442fcfbfa2f # 4.8.0
45-
with:
46-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47-
BRANCH: gh-pages
48-
FOLDER: site
49-
CLEAN: true
42+
- name: Setup git user for mike
43+
run: |
44+
git config --global user.name "${{ github.actor }}"
45+
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
46+
- name: Deploy to main
47+
if: ${{ github.ref_name == 'main' }}
48+
run: mike deploy --push --title "Unreleased (main)" main
49+
- name: Deploy to latest
50+
if: ${{ github.event_name == 'release' }}
51+
run: mike deploy --push --title "Latest (${{ github.event.release.tag_name }})" latest

mkdocs.base.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ plugins:
3535
include_yaml:
3636
- vars.yaml
3737

38+
extra:
39+
version:
40+
default: latest
41+
provider: mike
42+
3843
markdown_extensions:
3944
- pymdownx.highlight:
4045
anchor_linenums: true

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Dependencies for auto-generating and developing docs
2+
mike~=2.1
23
mkdocs~=1.5
34
mkdocs-material~=9.5
45
mkdocs-macros-plugin~=1.0

0 commit comments

Comments
 (0)