-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (46 loc) · 1.46 KB
/
nepal.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: Deploy NEPAL
on:
push:
branches:
- main
jobs:
build:
name: Deploy to nepal server
runs-on: ubuntu-latest
env:
DB_HOST: ${{ secrets.DB_HOST }}
DB_PORT: ${{ secrets.DB_PORT }}
DB_USERNAME: ${{ secrets.DB_USERNAME }}
DB_PASSWORD: ${{ secrets.DB_PASSWORD }}
DB_DATABASE: ${{ secrets.DB_DATABASE_NP }}
steps:
- name: Checkout 🛎️
uses: actions/checkout@v1
- name: Use Node.js 18.x
uses: actions/setup-node@v1
with:
node-version: 18.x
- name: Install dependencies
run: npm install
- name: Run Migrations
run: npm run build
- name: Run Migrations
run: npm run migration:run
- name: Copy public folder
uses: appleboy/scp-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
source: "src,node_modules,build,package.json,Dockerfile,docker-compose-np.yml"
target: "/home/ubuntu/apps/coach-backend-np"
- name: executing remote ssh commands using ssh key
uses: appleboy/[email protected]
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
script: |
cd /home/ubuntu/apps/coach-backend-np
sudo docker build -t coach-backend-np .
sudo docker-compose -f docker-compose-np.yml up -d