-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (31 loc) · 982 Bytes
/
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
name: Deploy to GitHub Pages
on:
push:
branches:
- main # 当推送到 main 分支时触发
jobs:
build:
runs-on: ubuntu-latest
steps:
# Checkout the repository
- name: Checkout code
uses: actions/checkout@v2
# Set up Node.js environment
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '23' # 使用适合 Vue 项目的 Node 版本
# Install dependencies
- name: Install dependencies
run: npm install
# Build the Vue project
- name: Build Vue project
run: npm run build
# Deploy to GitHub Pages
- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages # 部署到 gh-pages 分支
folder: dist # 构建后的文件夹(默认为 dist)
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # GitHub 提供的自动化 token