-
Notifications
You must be signed in to change notification settings - Fork 0
32 lines (31 loc) · 1008 Bytes
/
Copy pathci.yml
File metadata and controls
32 lines (31 loc) · 1008 Bytes
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
name: CI Github Pages
on:
#监听push操作
push:
branches:
- main # 这里只配置了main分支,所以只有推送main分支才会触发以下任务
workflow_dispatch:
jobs:
# 任务ID
build-and-deploy:
# 运行环境
runs-on: ubuntu-latest
# 步骤
steps:
# 官方action,将代码拉取到虚拟机
- name: Checkout ️
uses: actions/checkout@v3
- name: Setup Node.js environment
uses: actions/setup-node@v4.0.2
- name: Install and Build # 安装依赖、打包,如果提前已打包好无需这一步
run: |
mv ./vite.config.ghpages.ts ./vite.config.ts -f
npm -g install pnpm
pnpm install
pnpm run build
cp ./dist/index.html ./dist/404.html
- name: Deploy # 部署
uses: JamesIves/github-pages-deploy-action@v4.3.3
with:
branch: gh-pages # 部署后提交到那个分支
folder: dist # 这里填打包好的目录名称