新增action
This commit is contained in:
parent
f6d405dab2
commit
2bd3459524
31
.gitea/workflow/action
Normal file
31
.gitea/workflow/action
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
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
|
Loading…
x
Reference in New Issue
Block a user