更新 .gitea/workflows/build-action.yaml
Frontend CI/CD / build (web-office) (push) Successful in 2m37s Details

This commit is contained in:
z9130 2024-09-16 16:37:11 +08:00
parent c67451450e
commit 28a2c5eba1
1 changed files with 35 additions and 25 deletions

View File

@ -1,7 +1,10 @@
name: Frontend CI/CD
on: [push]
on:
push:
branches:
- main
- test
jobs:
build:
@ -12,38 +15,45 @@ jobs:
steps:
# Checkout the repository
# - name: Checkout the repository
# uses: https://gitea.com/actions/checkout@v4
# with:
# fetch-depth: 0
- name: Clone repository
- name: Install Git
run: |
apt-get update
apt-get install -y git
- name: Output Node.js and npm version
run: |
echo "Node.js version:"
node -v
echo "npm version:"
npm -v
- name: Clone repository
run: |
echo "Cloning repository..."
git clone http://172.19.183.27:3000/z9130/pansoft-plrl.git pansoft-plrl --depth 1
cd pansoft-plrl
# Optionally check out a specific branch
git checkout test
- run: npm config set registry https://registry.npmmirror.com
echo "Repository cloned and checked out to test branch."
- name: Set NPM registry
run: |
echo "Setting NPM registry..."
npm config set registry https://registry.npmmirror.com
echo "NPM registry set."
# Install pnpm
- name: Install pnpm
run: |
echo "Installing pnpm..."
npm install -g pnpm
echo "pnpm installed."
- name: Install dependencies and build
run: |
cd pansoft-plrl
echo "Installing dependencies..."
pnpm install --no-frozen-lockfile
pnpm build --filter apps/${{ matrix.project }}
# # 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 }}
# 你可以在这里添加更多步骤,例如部署到服务器或生成的静态文件存储。
echo "Dependencies installed."
echo "Building project..."
pnpm build --filter ${{ matrix.project }}
echo "Project built."