Update backend-ec2-deploy.yml #12
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: Deploy backend to EC2 | ||
on: | ||
[push] | ||
jobs: | ||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Executing remote ssh commands using ssh key | ||
uses: appleboy/ssh-action@master | ||
with: | ||
- name: Debug SSH Key | ||
run: echo "${{ secrets.EC2_SSH_KEY }}" | ||
- name: Debug SSH Connection | ||
run: ssh -v -i "${{ secrets.EC2_SSH_KEY}}" user@hostname | ||
- name: SSH into Server | ||
run: ssh -i "${{ secrets.EC2_SSH_KEY }}" ubuntu@ec2-13-53-198-163.eu-north-1.compute.amazonaws.com "echo Hello" | ||
script: | | ||
cd server | ||
npm install | ||
npm build | ||
npm i serve | ||
serve -p 3000 build | ||