2024-04-04 10:58:19 +08:00
|
|
|
name: Wiki Deploy
|
|
|
|
|
|
|
|
# 触发条件
|
2024-06-22 17:15:23 +08:00
|
|
|
on:
|
|
|
|
push:
|
2024-06-22 17:37:32 +08:00
|
|
|
branches: [ 'main' ]
|
2024-06-25 15:16:54 +08:00
|
|
|
paths:
|
|
|
|
- 'docs/**'
|
2024-07-10 13:24:20 +08:00
|
|
|
- 'docs-java/**'
|
|
|
|
- 'docs-bedrock/**'
|
2024-06-25 15:16:54 +08:00
|
|
|
- 'package.json'
|
2024-04-04 10:58:19 +08:00
|
|
|
|
|
|
|
# 设置权限
|
|
|
|
permissions:
|
|
|
|
contents: write
|
|
|
|
|
2024-06-10 10:26:44 +08:00
|
|
|
|
|
|
|
# 环境变量
|
|
|
|
env:
|
|
|
|
BASE_URL: NitWikit
|
|
|
|
|
2024-04-04 10:58:19 +08:00
|
|
|
# 任务
|
|
|
|
jobs:
|
|
|
|
deploy:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
# 拉取代码
|
|
|
|
- name: Checkout
|
2024-05-18 07:49:18 +08:00
|
|
|
uses: actions/checkout@v4
|
2024-09-30 23:47:40 +08:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2024-08-13 13:06:32 +08:00
|
|
|
- name: "setup pnpm"
|
|
|
|
uses: "pnpm/action-setup@v4"
|
|
|
|
- name: "setup node"
|
|
|
|
uses: "actions/setup-node@v4"
|
2024-06-25 15:16:54 +08:00
|
|
|
with:
|
|
|
|
node-version: 20
|
2024-04-04 10:58:19 +08:00
|
|
|
# 安装 Npm 并构建
|
2024-08-13 13:56:46 +08:00
|
|
|
- name: Install
|
|
|
|
run: pnpm install
|
|
|
|
- name: Build
|
2024-09-15 14:00:20 +08:00
|
|
|
run: pnpm run --parallel build
|
2024-04-04 10:58:19 +08:00
|
|
|
# 部署
|
|
|
|
- name: Deploy
|
|
|
|
uses: JamesIves/github-pages-deploy-action@v4
|
|
|
|
with:
|
2024-05-18 07:49:18 +08:00
|
|
|
folder: build
|