configured workflow for backEnd02 #3
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
name: Deploying to EC2 | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository//download the source code repository | |
uses: actions/checkout@v2 | |
- name: Install dependencies and build | |
run: | | |
ssh -i ec2-key-pair-videos.pem -o StrictHostKeyChecking=no "${{secrets.EC2_HOST}}" | |
cd Full-Stack-Project-Assessment | |
git pull | |
cd server | |
npm install | |
pm2 restart server.js |