-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (35 loc) · 934 Bytes
/
Copy pathdeploy.yml
File metadata and controls
38 lines (35 loc) · 934 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
name: Deploy to VPS
on:
push:
branches: [master]
workflow_dispatch:
concurrency:
group: deploy-utahon
cancel-in-progress: false
jobs:
deploy:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Deploy via SSH
uses: appleboy/ssh-action@v1.2.0
with:
host: ${{ secrets.VPS_HOST }}
username: ${{ secrets.VPS_USER }}
key: ${{ secrets.VPS_SSH_KEY }}
port: 22
script_stop: true
command_timeout: 8m
script: |
cd /opt/utahon
echo "[deploy] pull latest"
git pull --ff-only
echo "[deploy] npm ci"
npm ci --no-audit --no-fund
echo "[deploy] build"
npm run build
echo "[deploy] restart service"
systemctl restart utahon
sleep 2
systemctl is-active utahon
echo "[deploy] done"