-
Notifications
You must be signed in to change notification settings - Fork 4
39 lines (33 loc) · 1.06 KB
/
gh-pages.yml
File metadata and controls
39 lines (33 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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