更新 .gitea/workflows/build-action.yaml

This commit is contained in:
z9130 2024-09-17 12:12:18 +08:00
parent 9d7e3be2de
commit 4593e2617b
1 changed files with 36 additions and 19 deletions

View File

@ -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