ci: Support seperate update of branch docs (#14079)

This commit is contained in:
SWHL 2024-10-24 11:10:10 +08:00 committed by GitHub
parent 661cda1289
commit 19926a69cd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -4,6 +4,8 @@ on:
branches:
- master
- main
- "release/**"
permissions:
contents: write
jobs:
@ -14,7 +16,7 @@ jobs:
- name: Configure Git Credentials
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
git config user.email github-actions[bot]@users.noreply.github.com
- uses: actions/setup-python@v5
with:
python-version: 3.x
@ -28,4 +30,6 @@ jobs:
- run: pip install mike mkdocs-material jieba mkdocs-git-revision-date-localized-plugin mkdocs-git-committers-plugin-2 mkdocs-static-i18n
- run: |
git fetch origin gh-pages --depth=1
mike deploy --push --update-aliases main latest
mike deploy --push ${{ github.ref_name }}
mike alias main latest
mike set-default main