Skip to content

revert test

revert test #12

Workflow file for this run

name: Deploy Project to EC2
on:
push:
branches:
- main
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Set up SSH
run: |
mkdir -p ~/.ssh
echo "${{ secrets.EC2_SSH_KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan -H ${{ secrets.EC2_HOST }} >> ~/.ssh/known_hosts
- name: Connect to EC2 and deploy
run: |
ssh -i ~/.ssh/id_rsa ${{ secrets.EC2_USER }}@${{ secrets.EC2_HOST }} "\
source ~/.nvm/nvm.sh && \
cd Full-Stack-Project-Assessment && \
git checkout main && \
git pull && \
npm run build && \
pm2 kill && \
pm2 start npm --name "video-recommendations" -- start && \
pm2 save"