-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #37 from Praashh/app/deployment
feat: nginx file, cd files
- Loading branch information
Showing
8 changed files
with
141 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: Deploy Client | ||
|
||
on: | ||
push: | ||
paths: | ||
- "apps/client/**" | ||
- "packages/db/**" | ||
- "packages/order-queue/**" | ||
branches: | ||
- master | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: SSH and deploy | ||
env: | ||
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} | ||
run: | | ||
echo "$SSH_PRIVATE_KEY" > keyfile | ||
chmod 600 keyfile | ||
ssh -o StrictHostKeyChecking=no -t -i keyfile [email protected] "sudo bash /home/ubuntu/offchain-orderbook/apps/client/deploy.sh" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: Deploy Express Backend | ||
|
||
on: | ||
push: | ||
paths: | ||
- "apps/server/**" | ||
- "packages/db/**" | ||
- "packages/order-queue/**" | ||
branches: | ||
- master | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: SSH and deploy | ||
env: | ||
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} | ||
run: | | ||
echo "$SSH_PRIVATE_KEY" > keyfile | ||
chmod 600 keyfile | ||
ssh -o StrictHostKeyChecking=no -t -i keyfile [email protected] "sudo bash /home/ubuntu/offchain-orderbook/apps/server/deploy.sh" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
export PATH=$PATH:/home/ubuntu/.nvm/versions/node/v18.20.4/bin | ||
|
||
cd /home/ubuntu/offchain-orderbook | ||
git pull origin master | ||
npm run build | ||
pm2 stop client | ||
pm2 start npm --name "client" -- run "start:client" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
export PATH=$PATH:/home/ubuntu/.nvm/versions/node/v18.20.4/bin | ||
|
||
cd /home/ubuntu/offchain-orderbook | ||
git pull origin master | ||
npm run build | ||
pm2 stop server | ||
pm2 start npm --name "server" -- run "start:server" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
events { | ||
worker_connections 1024; | ||
} | ||
|
||
http { | ||
# Configuration for the Next.js app | ||
server { | ||
server_name opinix.live; | ||
|
||
location / { | ||
proxy_pass http://localhost:3000; | ||
proxy_http_version 1.1; | ||
proxy_set_header Upgrade $http_upgrade; | ||
proxy_set_header Connection 'upgrade'; | ||
proxy_set_header Host $host; | ||
proxy_cache_bypass $http_upgrade; | ||
} | ||
|
||
listen 80; | ||
} | ||
|
||
# Configuration for the Express backend | ||
server { | ||
server_name server.opinix.live; | ||
|
||
location / { | ||
proxy_pass http://localhost:3001; | ||
proxy_http_version 1.1; | ||
proxy_set_header Upgrade $http_upgrade; | ||
proxy_set_header Connection 'upgrade'; | ||
proxy_set_header Host $host; | ||
proxy_cache_bypass $http_upgrade; | ||
} | ||
|
||
listen 80; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters