aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows
diff options
context:
space:
mode:
authorLeander <80996591+schererleander@users.noreply.github.com>2025-05-30 01:27:25 +0200
committerGitHub <noreply@github.com>2025-05-30 01:27:25 +0200
commit15e4f5f9edfa3a3e769a6fcf7034f03a20093657 (patch)
treecaed321173d0ea8382a765eaa038d74ece56e4d2 /.github/workflows
parent28ad8adb1a435103dba02cc61be3757d414ab632 (diff)
Update deploy.yml
Diffstat (limited to '.github/workflows')
-rw-r--r--.github/workflows/deploy.yml18
1 files changed, 15 insertions, 3 deletions
diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml
index 88671f7..2099d29 100644
--- a/.github/workflows/deploy.yml
+++ b/.github/workflows/deploy.yml
@@ -25,23 +25,35 @@ jobs:
npm ci
npm run build # Vite’s default output dir is `dist/`
- # 4) Copy build output to VPS via SCP
+ # 4) Clean remote dir
+ - name: Clean remote directory
+ uses: appleboy/ssh-action@master
+ with:
+ host: ${{ secrets.VPS_HOST }}
+ username: ${{ secrets.VPS_USER }}
+ key: ${{ secrets.VPS_SSH_KEY }}
+ port: ${{ secrets.VPS_PORT }}
+ script: |
+ rm -rf ${{ secrets.VPS_DESTINATION }}/*
+
+ # 5) Copy build output to VPS via SCP
- name: Deploy build via SCP
uses: appleboy/scp-action@master
with:
host: ${{ secrets.VPS_HOST }}
username: ${{ secrets.VPS_USER }}
key: ${{ secrets.VPS_SSH_KEY }}
- port: 22
+ port: ${{ secrets.VPS_PORT }}
source: "dist/*"
target: ${{ secrets.VPS_DESTINATION }}
- # 5) Restart Nginx inside Docker on your VPS
+ # 6) Restart Nginx inside Docker on your VPS
- name: Restart Nginx (Docker)
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.VPS_HOST }}
username: ${{ secrets.VPS_USER }}
key: ${{ secrets.VPS_SSH_KEY }}
+ port: ${{ secrets.VPS_PORT }}
script: |
docker restart nginx