diff --git a/.gitea/workflows/build-action.yaml b/.gitea/workflows/build-action.yaml index 66d1cda8..6f9716dc 100644 --- a/.gitea/workflows/build-action.yaml +++ b/.gitea/workflows/build-action.yaml @@ -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 \ No newline at end of file