33 lines
2.3 KiB
YAML
33 lines
2.3 KiB
YAML
name: Build Vue Project
|
||
|
||
on: [push]
|
||
|
||
jobs:
|
||
build:
|
||
runs-on: ubuntu-latest
|
||
steps:
|
||
- name: Checkout code
|
||
uses: actions/checkout@v4 # 注意:在Gitea中,可能使用gitea的actions/checkout,但通常兼容
|
||
|
||
- name: Set up Node.js
|
||
uses: actions/setup-node@v3
|
||
with:
|
||
node-version: '20'
|
||
|
||
- name: Install dependencies
|
||
run: npm ci
|
||
|
||
- name: Build
|
||
run: npm run build
|
||
|
||
# 将构建产物打包成tar.gz
|
||
- name: Archive build output
|
||
run: tar -zcvf dist.tar.gz dist
|
||
|
||
# 上传Artifact
|
||
- name: Upload artifact
|
||
uses: actions/upload-artifact@v3
|
||
with:
|
||
name: dist-artifact
|
||
path: dist.tar.gz
|
||
retention-days: 7 retention-days: 7 # 产物保留天数 |