2024-09-16 12:02:26 +08:00
|
|
|
name: Frontend CI/CD
|
|
|
|
|
2024-09-16 11:40:49 +08:00
|
|
|
on: [push]
|
|
|
|
|
2024-09-16 13:32:48 +08:00
|
|
|
|
2024-09-16 11:40:49 +08:00
|
|
|
jobs:
|
2024-09-16 12:02:26 +08:00
|
|
|
build:
|
2024-09-16 13:30:58 +08:00
|
|
|
runs-on: ubuntu-22.04:host
|
2024-09-16 12:02:26 +08:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
project: [web-office]
|
|
|
|
|
2024-09-16 11:40:49 +08:00
|
|
|
steps:
|
2024-09-16 12:02:26 +08:00
|
|
|
# Set up Node.js environment
|
|
|
|
- name: Set up Node.js
|
2024-09-16 13:30:58 +08:00
|
|
|
uses: https://gitee.com/z9130/actions-setup-node.git@v3
|
2024-09-16 12:02:26 +08:00
|
|
|
with:
|
|
|
|
node-version: "22" # 确保使用与你项目兼容的 Node.js 版本
|
|
|
|
|
2024-09-16 12:14:28 +08:00
|
|
|
# Checkout the repository
|
|
|
|
- name: Checkout repository
|
|
|
|
uses: https://gitee.com/z9130/actions-checkout.git@v4
|
|
|
|
|
2024-09-16 12:02:26 +08:00
|
|
|
# Install pnpm
|
|
|
|
- name: Install pnpm
|
|
|
|
run: npm install -g pnpm
|
|
|
|
|
|
|
|
# Install dependencies using Turborepo
|
|
|
|
- name: Install dependencies with Turborepo
|
|
|
|
run: pnpm install
|
|
|
|
|
|
|
|
# Build the project
|
|
|
|
- name: Build project
|
|
|
|
env:
|
|
|
|
TURBO_FORCE: true # 强制全量构建,确保 Turborepo 正确地优化构建过程
|
|
|
|
run: pnpm build --filter apps/${{ matrix.project }}
|
|
|
|
|
|
|
|
# 你可以在这里添加更多步骤,例如部署到服务器或生成的静态文件存储。
|