feat(mi): polish xiaomi create. #15
This file contains 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: auto-generate-gitbook | |
on: #在main分支上进行push时触发 | |
push: | |
branches: | |
- master | |
jobs: | |
build-to-gh-pages: | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout master | |
uses: actions/checkout@v2 | |
with: | |
ref: master | |
- name: install nodejs | |
uses: actions/setup-node@v1 | |
- name: configue gitbook | |
run: | | |
npm install -g gitbook-cli | |
gitbook install | |
- name: generate _book folder | |
run: | | |
gitbook build | |
- name: push _book to branch gh-pages | |
env: | |
TOKEN: ${{ secrets.TOKEN }} | |
REF: github.com/${{github.repository}} | |
MYEMAIL: weipeng2k@126.com # !!记得修改为自己邮箱 | |
MYNAME: ${{github.repository_owner}} | |
run: | | |
cd _book | |
git config --global user.email "${MYEMAIL}" | |
git config --global user.name "${MYNAME}" | |
git init | |
git remote add origin https://${REF} | |
git add . | |
git commit -m "Updated By Github Actions With Build ${{github.run_number}} of ${{github.workflow}} For Github Pages" | |
git branch -M master | |
git push --force --quiet "https://${TOKEN}@${REF}" master:gh-pages |