potential cors fix 2 #40
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 code to EC2 instance | |
on: | |
push: | |
branches: [ main ] | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Rebuild backend and deploy | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.EC2_URL }} | |
username: 'ubuntu' | |
key: ${{ secrets.SSH_PRIVATE_KEY }} | |
script: | | |
cd /home/ubuntu/dishzero/DishZero/backend | |
export NVM_DIR=~/.nvm | |
source ~/.nvm/nvm.sh | |
npm i -g pm2 | |
npm i -g yarn | |
pm2 stop dishzero | |
git pull | |
yarn install | |
yarn build | |
pm2 start yarn --name "dishzero" -- start |