setup: vm set up and env changes #2
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: iConnect Server | |
on: | |
pull_request: | |
branches: [main] | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Deploy using SSH | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.HOST }} | |
username: ${{ secrets.USERNAME }} | |
key: ${{ secrets.PRIVATE_KEY }} | |
port: 22 | |
script: | | |
/home/azureuser/iconnect | |
git pull origin main | |
git status | |
pm2 kill | |
export NODE_ENV=production | |
npm install | |
npm run tsc | |
npm run start:prod # Start the application using pm2 |