Updating api route #18
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 Application | |
on: | |
push: | |
branches: | |
- main # or any branch you want to deploy from | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Deploy to remove server | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.REMOTE_HOST }} | |
username: ${{ secrets.REMOTE_USER }} | |
key: ${{ secrets.SSH_PRIVATE_KEY }} | |
script: | | |
cd workplace/Questionnaire | |
git pull origin main | |
npm install | |
cd ws-events | |
npm install | |
npm run build | |
npm link | |
cd .. | |
cd frontend | |
npm link @ruchir28/ws-events | |
cd ../backend | |
npm link @ruchir28/ws-events | |
cd .. | |
export REACT_APP_BACKEND_URL=${{ secrets.REACT_APP_BACKEND_URL }} | |
export REACT_APP_WS_URL=${{ secrets.REACT_APP_WS_URL }} | |
npm run build:frontend | |
npm run build:backend | |
sudo rsync -av --delete frontend/build/ /var/www/Questionnaire/ | |
cd backend | |
pm2 reload dist/index.js |