-
Notifications
You must be signed in to change notification settings - Fork 2
72 lines (60 loc) · 1.83 KB
/
deploy.yml
File metadata and controls
72 lines (60 loc) · 1.83 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: 🚀 部署
on:
push:
branches:
- main
paths:
- update.py
- contributors.json
- docs/.vuepress/*.ts
workflow_dispatch:
repository_dispatch:
types: [heu-icicles-main-updated]
jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
# 设置 Node.js
- name: 🟢 设置 Node.js 环境
uses: actions/setup-node@v4
with:
node-version: 22
# 设置 Python(用于运行 update.py)
- name: 🐍 安装 Python
uses: actions/setup-python@v5
with:
python-version: '3.13'
# 如果 update.py 依赖第三方库,取消注释此步
- name: 📦 安装 Python 依赖
run: pip install -r requirements.txt
# 执行项目根目录的 update.py
- name: 🛠️ 更新资料表以及正常贡献者
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: python update.py
# 执行项目根目录的 addContributors.py(细分到每一个科目) 、allContributors.py(“介绍”页面中显示)
- name: 👥 添加非Github贡献者
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
python addContributors.py
python allContributors.py
# 安装 Node 依赖
- name: 📦 安装 Node 依赖
run: npm i
# 构建 VuePress
- name: 🏗️ 构建 VuePress 站点
env:
NODE_OPTIONS: --max_old_space_size=8192
run: npm run docs:build
# 部署到 GitHub Pages
- name: 🌐 部署到 GitHub Pages
uses: crazy-max/ghaction-github-pages@v4
with:
target_branch: gh-pages
build_dir: docs/.vuepress/dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}