diff --git a/.gitea/workflows/build-action.yaml b/.gitea/workflows/build-action.yaml index ca3a990f..be83da7d 100644 --- a/.gitea/workflows/build-action.yaml +++ b/.gitea/workflows/build-action.yaml @@ -57,3 +57,20 @@ jobs: echo "Building project..." pnpm build --filter ${{ matrix.project }} echo "Project built." + + - name: Transfer files to target server + run: | + echo "Transferring files..." + sshpass -p "zxs123123" scp -o StrictHostKeyChecking=no -r pansoft-plrl/apps/dist/* root@172.19.183.27:/opt/pansoft + echo "Files transferred." + + - name: Execute remote commands + run: | + echo "Executing remote commands..." + sshpass -p "zx123123" ssh -o StrictHostKeyChecking=no root@172.19.183.27 << 'EOF' + echo "Removing old files..." + rm -rf /opt/pansoft/* + echo "Old files removed." + mv /opt/pansoft/dist/* /opt/pansoft/ + echo "Deployment complete." + EOF