From 28a2c5eba12345fd9e2706e1bf00005761f42ab3 Mon Sep 17 00:00:00 2001 From: z9130 <984661593@qq.com> Date: Mon, 16 Sep 2024 16:37:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20.gitea/workflows/build-act?= =?UTF-8?q?ion.yaml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/build-action.yaml | 60 +++++++++++++++++------------- 1 file changed, 35 insertions(+), 25 deletions(-) diff --git a/.gitea/workflows/build-action.yaml b/.gitea/workflows/build-action.yaml index 089fc0ac..ca3a990f 100644 --- a/.gitea/workflows/build-action.yaml +++ b/.gitea/workflows/build-action.yaml @@ -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."