更新 .gitea/workflows/build-action.yaml
Frontend CI/CD / build (web-office) (push) Failing after 32s Details

This commit is contained in:
z9130 2024-09-16 19:27:44 +08:00
parent 634c8c7b32
commit 6b65ce3c8b
1 changed files with 21 additions and 10 deletions

View File

@ -15,18 +15,15 @@ jobs:
steps:
# - name: Install Git
# run: |
# apt-get update
# apt-get install -y git
# 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
# Clone repository
- name: Clone repository
run: |
echo "Cloning repository..."
@ -35,6 +32,7 @@ jobs:
git checkout test
echo "Repository cloned and checked out to test branch."
# Set NPM registry
- name: Set NPM registry
run: |
echo "Setting NPM registry..."
@ -48,25 +46,38 @@ jobs:
npm install -g pnpm
echo "pnpm installed."
# Cache pnpm dependencies
- name: Cache pnpm store
uses: 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
pnpm install
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
run: |
echo "Transferring files..."
cd pansoft-plrl
echo "Local files in the directory:"
ls
sshpass -p "zxs123123" scp -o StrictHostKeyChecking=no -r ./apps/${{ matrix.project }}/dist.zip root@172.19.183.27:/opt/pansoft
sshpass -p "zxs123123" scp -o StrictHostKeyChecking=no -r ./apps/web-office/dist.zip root@172.19.183.27:/opt/pansoft
echo "Files transferred."
# Execute remote commands
- name: Execute remote commands
run: |
echo "Executing remote commands..."
@ -76,4 +87,4 @@ jobs:
echo "Old files removed."
mv /opt/pansoft/dist/* /opt/pansoft/
echo "Deployment complete."
EOF
EOF