From 4593e2617bd25e24fd2605be1884b421a517f5eb Mon Sep 17 00:00:00 2001 From: z9130 <984661593@qq.com> Date: Tue, 17 Sep 2024 12:12:18 +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 | 55 +++++++++++++++++++----------- 1 file changed, 36 insertions(+), 19 deletions(-) diff --git a/.gitea/workflows/build-action.yaml b/.gitea/workflows/build-action.yaml index 67b8b7b2..1bee558f 100644 --- a/.gitea/workflows/build-action.yaml +++ b/.gitea/workflows/build-action.yaml @@ -13,15 +13,31 @@ jobs: matrix: project: [web-office] + before_script: + - corepack enable + - corepack prepare pnpm@latest-9 --activate + - pnpm config set store-dir .pnpm-store + script: + - pnpm install + cache: + paths: + - .pnpm-store + steps: # Output Node.js and npm version - name: Output Node.js and npm version run: | + echo "Node.js version:" node -v echo "npm version:" npm -v + corepack enable + corepack prepare pnpm@latest-9 --activate + pnpm config set store-dir ~/.pnpm-store + echo "pnpm version:" + pnpm -v # Clone repository - name: Clone repository @@ -32,26 +48,27 @@ jobs: git checkout test echo "Repository cloned and checked out to test branch." - # Cache pnpm dependencies - - name: Cache pnpm store - uses: https://gitea.com/actions/cache@v3 - id: pnpm-cache - with: - path: ~/.pnpm-store - key: ${{ runner.os }}-pnpm-store-${{ hashFiles('pansoft-plrl/pnpm-lock.yaml') }} - restore-keys: | - ${{ runner.os }}-pnpm-store- + # # Cache pnpm dependencies + # - name: Cache pnpm store + # uses: https://gitea.com/actions/cache@v3 + # id: pnpm-cache + # with: + # path: ~/.pnpm-store + # key: ${{ runner.os }}-pnpm-store-${{ hashFiles('pansoft-plrl/pnpm-lock.yaml') }} + # restore-keys: | + # ${{ runner.os }}-pnpm-store- - # # Install dependencies and build - # - name: Install dependencies and build - # run: | - # cd pansoft-plrl - # echo "Installing dependencies..." - # pnpm install --no-frozen-lockfile - # echo "Dependencies installed." - # echo "Building project..." - # pnpm build --filter ${{ matrix.project }} - # echo "Project built." + # Install dependencies and build + - name: Install dependencies and build + run: | + pnpm config set store-dir ~/.pnpm-store + cd pansoft-plrl + echo "Installing dependencies..." + pnpm install --no-frozen-lockfile + echo "Dependencies installed." + echo "Building project..." + pnpm build --filter ${{ matrix.project }} + echo "Project built." # Transfer files to target server - name: Transfer files to target server