Skip to content

Commit

Permalink
Update video-backend-EC2-deploy.yml
Browse files Browse the repository at this point in the history
Signed-off-by: Tsione Temesgen Abraham <tsionetemesgenabraham@gmail.com>
  • Loading branch information
TsioneTemesgenAbraham authored Feb 9, 2024
1 parent 8332e16 commit df0d0f5
Showing 1 changed file with 9 additions and 17 deletions.
26 changes: 9 additions & 17 deletions .github/workflows/video-backend-EC2-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,20 @@ on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:
runs-on: self-hosted
deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v2

- name: Setup Node.js
uses: actions/setup-node@v4
- name: Set up SSH keys
uses: webfactory/ssh-agent@v0.5.3
with:
node-version: 18

- name: Install Dependencies
run: npm ci

- name: Build Application
run: npm run build --if-present
ssh-private-key: ${{ secrets.EC2_PRIVATE_KEY }}

- name: Restart PM2 Process
run: sudo pm2 restart server
- name: Deploy Backend
run: |
ssh -i ${{ secrets.EC2_PRIVATE_KEY }} ubuntu@3.11.9.16 'cd /home/ubuntu/server && git pull origin main && npm install && npm run build && pm2 restart server.js'

0 comments on commit df0d0f5

Please sign in to comment.