Skip to content

Merge pull request #213 from samarsault/master #14

Merge pull request #213 from samarsault/master

Merge pull request #213 from samarsault/master #14

Workflow file for this run

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'