-
Notifications
You must be signed in to change notification settings - Fork 7
45 lines (39 loc) · 1.45 KB
/
build-github.yml
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
name: note build github
# 触发workflow的条件
on:
push:
# 只有main分支发生push事件时,才会触发workflow
branches: [main]
env:
PERSONAL_TOKEN: ${{ secrets.PERSONAL_TOKEN }} # 个人访问令牌
# jobs表示执行的一项或多项任务
jobs:
build: # 任务的job_id,具体名称自定义,这里build代表打包
runs-on: ubuntu-latest # runs-on字段指定运行所需要的虚拟机环境。注意:这个是必填字段
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- name: 设置 Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: 安装依赖
run: |
corepack enable
npm ci
- name: 构建文档
env:
NODE_OPTIONS: --max_old_space_size=8192
run: |-
npm run docs:build
# 部署到另一个GitHub仓库
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
personal_token: ${{ secrets.PERSONAL_TOKEN }}
publish_dir: ./src/.vuepress/dist
external_repository: pysio2007/Vue-Blog-WebSite
publish_branch: main