Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
riddhesh-mahajan committed Oct 30, 2023
1 parent ec1cafe commit 82d0c26
Showing 1 changed file with 1 addition and 37 deletions.
38 changes: 1 addition & 37 deletions .github/workflows/DeployPipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,42 +20,6 @@ jobs:
host: ${{ secrets.EC2_HOST }}
username: ${{ secrets.EC2_USERNAME }}
key: ${{ secrets.EC2_SSH_KEY }}
source: ./apps/
source: ./
target: /home/ubuntu/slash/
overwrite: true

- name: SSH into EC2 and restart app
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.EC2_HOST }}
username: ${{ secrets.EC2_USERNAME }}
key: ${{ secrets.EC2_SSH_KEY }}
script: |
# Install nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
# Install the latest version of Node.js
nvm install node
# Use the installed Node.js version
nvm use node
# Install pm2 globally
npm install -g pm2
# Stop all pm2 services
pm2 stop all
# Landing
cd slash/apps/landing
# Install dependencies
npm install
# Stop and start your application using pm2
pm2 restart all
pm2 stop slash_landing
pm2 start npm --name slash_landing -- start

0 comments on commit 82d0c26

Please sign in to comment.