From f5b2f759927ac3cbe711686d0fc515d48120bf64 Mon Sep 17 00:00:00 2001 From: z9130 <984661593@qq.com> Date: Mon, 16 Sep 2024 16:47:00 +0800 Subject: [PATCH] ssh --- .gitea/workflows/build-action.yaml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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