Skip to content

Instantly share code, notes, and snippets.

@wgzhao
Created October 29, 2021 05:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wgzhao/77f50998b1186380b7f7045e3c75f52e to your computer and use it in GitHub Desktop.
Save wgzhao/77f50998b1186380b7f7045e3c75f52e to your computer and use it in GitHub Desktop.
MkDocs action setup
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 docs@dummy.bot.com
- 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