Skip to content

Merge pull request #6 from xueyuanying/feature/docs #12

Merge pull request #6 from xueyuanying/feature/docs

Merge pull request #6 from xueyuanying/feature/docs #12

Workflow file for this run

name: Publish Document
on:
push:
branches:
- '**' # 监听所有分支
pull_request:
types: [opened, synchronize, reopened]
branches: [main] # PR 创建/更新时触发(仅测试)
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