-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (35 loc) · 1.05 KB
/
deploy.yml
File metadata and controls
41 lines (35 loc) · 1.05 KB
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
41
on:
push:
branches:
- main
name: 🚀 Deploy pushes on main branch
env:
NEXT_PUBLIC_BACKEND_URL: https://taskmasterapi.rosanpaudel.com.np
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 --force && 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: ".next"
target: ~/taskmaster-client/
- name: ♻️ Restart the server
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USER }}
key: ${{ secrets.KEY }}
script: cd ~/taskmaster-client && git pull && pnpm install && pm2 restart 2