-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (35 loc) · 1010 Bytes
/
deploy.yml
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
39
40
on:
push:
branches:
- main
name: 🚀 Deploy pushes on main branch
jobs:
web-deploy:
name: 🎉 Deploy
runs-on: ubuntu-latest
steps:
- name: 🚚 Get latest code
uses: actions/checkout@v3
- name: 🖥 Use Node.js 21
uses: actions/setup-node@v2
with:
node-version: "21"
- name: 🔨 Build Project
run: |
npm install
npm run build
- name: 📂 Copy Build Files to the server
uses: appleboy/scp-action@v0.1.7
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USER }}
key: ${{ secrets.KEY }}
source: "dist"
target: ~/taskmaster-server/
- name: ♻️ Restart the server
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USER }}
key: ${{ secrets.KEY }}
script: cd ~/taskmaster-server && git pull && pnpm install && pm2 restart 0