Merge pull request #14 from xueyuanying/feature/docs #19
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: Publish Document | |
| on: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: # 仍保留手动触发的功能 | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v2 | |
| with: | |
| persist-credentials: false | |
| - name: Prepare build environment | |
| run: | | |
| sudo apt install python3-pip python3-dev python3-setuptools | |
| sudo pip3 install -U pygments==2.17.2 pymdown-extensions | |
| sudo pip3 install mkdocs-exclude | |
| sudo pip3 install mkdocs-material==9.6.8 | |
| sudo pip3 install jieba==0.42.1 | |
| sudo pip3 install mkdocs-minify-plugin | |
| sudo pip3 install mkdocs-static-i18n | |
| - name: Build the document | |
| run: mkdocs build | |
| - name: Add CNAME file | |
| run: echo 'docs.tronlink.org' > site/CNAME | |
| - name: Build and Deploy | |
| uses: JamesIves/github-pages-deploy-action@v4 | |
| with: | |
| branch: gh-pages # 部署目标分支 | |
| folder: site # 构建产物目录 | |
| token: ${{ secrets.GITHUB_TOKEN }} # 使用 GitHub 默认的 Token |