31 lines
1.7 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

name: Build Vue Project
on:
push:
branches: [ main ] # 主分支推送时触发
pull_request: # 开启PR时触发构建
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '18' # 指定Node版本
- name: Install dependencies
run: npm ci # 更安全的依赖安装
- name: Build project
run: npm run build # 执行构建命令
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: dist # 产物名称
path: dist # 构建输出的目录Vue项目默认是dist