Skip to content

数据类型:修改部分内容 #89

数据类型:修改部分内容

数据类型:修改部分内容 #89

Workflow file for this run

name: build-my-book
on: [push]
jobs:
build:
env:
TOKEN: ${{ secrets.TOKEN }}
REF: github.com/${{github.repository}}
MYEMAIL: 1312560006@qq.com
MYNAME: ${{github.repository_owner}}
REPO_NAME: ${{ github.event.repository.name }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 10.x
- name: Pregenerate SUMMARY.md
run: |
find . -maxdepth 1 -type d \( ! -name . \) -not -path "./.*" -not -path "./node*" -not -path "./_*" -exec bash -c "cd '{}'; pwd; cp -f ../GenerateSummary.py ./ && python3 GenerateSummary.py; rm GenerateSummary.py" \;
- name: Install GitBook
run: |
npm install -g gitbook-cli
gitbook --version
- name: Build all books
run: |
find . -maxdepth 1 -type d \( ! -name . \) -not -path "./.*" -not -path "./node*" -not -path "./_*" -exec bash -c "cd '{}'; pwd && gitbook init; cp -f ../book.json ./; gitbook install; rm -r _book; gitbook build; rm -r node_modules; rm book.json" \;
- name: Push all files to master branch
run: |
git config --global user.email "${MYEMAIL}"
git config --global user.name "${MYNAME}"
git remote add ${REPO_NAME} "https://${TOKEN}@${REF}"
git add .
git commit -m "commited by GitHub workflow, built git book"
git push --force ${REPO_NAME}
- name: Sync repo to Gitee
run: |
git remote add Gitee${REPO_NAME} https://${{ secrets.GITEE_USER_NAME }}:${{ secrets.GITEE_TOKEN }}@gitee.com/${{ secrets.GITEE_USER_NAME }}/${REPO_NAME}.git
git fetch --unshallow ${REPO_NAME}
git push --force Gitee${REPO_NAME} master:master