Created
October 29, 2021 05:55
-
-
Save wgzhao/77f50998b1186380b7f7045e3c75f52e to your computer and use it in GitHub Desktop.
MkDocs action setup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: mkdoc-release | |
on: | |
push: | |
tags: | |
- '*' | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: 3.x | |
- run: pip install mkdocs-material mike | |
- name: Setup doc deploy | |
run: | | |
git config --global user.name Docs deploy | |
git config --global user.email [email protected] | |
- name: build docs | |
run: mike deploy $(git describe --abbrev=0 --tags) | |
- name: Create redirect form old docs | |
run: | | |
git checkout gh-pages | |
test -f 404.html && echo "Redirect already set" && exit 0 | |
git checkout master -- 404.html | |
git add 404.html | |
git commit -m "chore: set docs redirect" --no-verify | |
git push origin gh-pages -f |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment