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