新增action
This commit is contained in:
parent
094c6ba904
commit
9804f9edfd
32
.gitea/workflows/action.yaml
Normal file
32
.gitea/workflows/action.yaml
Normal file
@ -0,0 +1,32 @@
|
||||
name: Build Vue Project
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main, master ] # 在推送到主分支时触发
|
||||
workflow_dispatch: # 允许手动触发工作流
|
||||
|
||||
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: '20' # 使用最新的 LTS 版本
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci # 使用锁定文件安装依赖
|
||||
|
||||
- name: Build project
|
||||
run: npm run build # 执行构建命令
|
||||
|
||||
- name: Archive build output
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: dist-artifact
|
||||
path: dist # Vue 项目默认构建输出目录
|
||||
retention-days: 7 # 产物保留天数
|
Loading…
x
Reference in New Issue
Block a user