-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (33 loc) · 1.03 KB
/
ci.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
name: Deploy to GitHub Pages
on:
push:
branches:
- main # 当推送到 main 分支时触发
jobs:
build:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
# Checkout the repository
- name: Checkout code
uses: actions/checkout@v4
# Set up Node.js environment
- name: Set up Node.js
uses: actions/[email protected]
with:
node-version: '23.x' # 使用适合 Vue 项目的 Node 版本
# Install pnpm
- name: Install pnpm
run: npm install -g pnpm # 安装 pnpm
# Install dependencies using pnpm
- name: Install dependencies
run: pnpm install # 使用 pnpm 安装依赖
# Build the Vue project using pnpm
- name: Build Vue project
run: pnpm run build # 使用 pnpm 进行构建
# Deploy to GitHub Pages
- name: Deploy to GitHub Pages
uses: JamesIves/[email protected]
with:
folder: dist # 构建后的文件夹(默认为 dist)