ci: align gitea workflow and frontend build
CRM/ERP CI / Backend Tests (Python) (push) Successful in 1m57s
CRM/ERP CI / Frontend Build (Vue3 + Vite) (push) Successful in 48s
CRM/ERP CI / Docker Compose Build (push) Successful in 6s

This commit is contained in:
2026-05-11 21:47:54 +08:00
parent 7df1045e77
commit 5b41f28943
2 changed files with 17 additions and 17 deletions
+7 -7
View File
@@ -4,9 +4,13 @@ on:
push: push:
branches: branches:
- main - main
- master - ui-change
- 'feature/**' - 'feature/**'
- 'fix/**' - 'fix/**'
pull_request:
branches:
- main
- ui-change
workflow_dispatch: workflow_dispatch:
jobs: jobs:
@@ -46,7 +50,7 @@ jobs:
- name: Run pytest - name: Run pytest
run: | run: |
source .venv/bin/activate source .venv/bin/activate
pytest tests/ -v --tb=short || echo "⚠️ 部分测试失败(可能需要数据库连接)" pytest tests/ -v --tb=short
# ───────────────────────────────────────────── # ─────────────────────────────────────────────
# 前端 Vue 构建检查 # 前端 Vue 构建检查
@@ -72,11 +76,7 @@ jobs:
- name: Install dependencies - name: Install dependencies
run: | run: |
if [ -f package-lock.json ]; then npm ci
npm ci
else
npm install
fi
- name: Build - name: Build
run: npm run build run: npm run build
+10 -10
View File
@@ -1,17 +1,17 @@
# ============================================================ # ============================================================
# Stage 1: Build — 基于 Node 18 Alpine 构建 Vue3 前端产物 # Stage 1: Build — 基于 Node 20 Alpine 构建 Vue3 前端产物
# ============================================================ # ============================================================
FROM node:18-alpine AS builder FROM node:20-alpine AS builder
WORKDIR /build WORKDIR /build
# 先拷贝依赖清单,利用 Docker 层缓存 # 先拷贝依赖清单,利用 Docker 层缓存
COPY frontend/package.json frontend/package-lock.json* ./ COPY frontend/package.json frontend/package-lock.json* ./
RUN npm install RUN npm ci
# 拷贝全部前端源码并执行生产构建 # 拷贝全部前端源码并执行生产构建
COPY frontend/ . COPY frontend/ .
RUN npm install -D @types/node && npm run build RUN npm run build
# ============================================================ # ============================================================
# Stage 2: Run — 极致轻量的 Nginx 运行时 # Stage 2: Run — 极致轻量的 Nginx 运行时