-
Notifications
You must be signed in to change notification settings - Fork 5
35 lines (33 loc) · 1.02 KB
/
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
name: Build & Deploy
on:
push:
branches: [production]
jobs:
deploy:
runs-on: ubuntu-18.04
steps:
- name: Deploy NodeJS app
uses: appleboy/[email protected]
with:
host: ${{secrets.SSH_HOST}} # IP address of the server you wish to ssh into
key: ${{secrets.SSH_KEY}} # Private or public key of the server
username: ${{ secrets.SSH_USERNAME }} # User of the server you want to ssh into
script: |
echo 'Deployment Started'
export NVM_DIR=~/.nvm
source ~/noodle_env.sh
source ~/.nvm/nvm.sh
nvm use 12
echo `node -v`
cd noodle
git checkout production
git pull origin production
cd client
npm i && npm run build
cd ../server
npm i
cd ..
pm2 stop ecosystem.config.js
pm2 start ecosystem.config.js
sudo service nginx restart
echo 'Deployment Complete'