forked from cse110-sp21-group11/cse110-sp21-group11
-
Notifications
You must be signed in to change notification settings - Fork 9
33 lines (30 loc) · 891 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
name: Deploy to Server
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Deploy Node.js App
uses: appleboy/ssh-action@v0.1.2
with:
host: ${{secrets.SSH_HOST}} # IP Address of Server
key: ${{secrets.SSH_KEY}} # Private/Public Key of Server
username: ${{secrets.SSH_USERNAME}} # user for Server
script: |
cd ../var/www/boojo.bitfrost.app/cse112-sp22-group1
git reset --hard origin/main
git pull origin main
cd src/back-end
rm constants.js
mv constants_prod.js constants.js
PATH=$PATH:/${{secrets.SSH_USERNAME}}/.nvm/versions/node/v16.14.2/bin
npm install
cd ../front-end
npm install
npm run build
cd ./prod
npm install
echo 'Deployed to DigitalOcean'