-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (35 loc) · 1.07 KB
/
azuredeploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: iConnect Server V1
on:
pull_request:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Debug Environment
run: |
echo "Current PATH: $PATH"
pm2 --version || true # Print pm2 version or continue if not found
npm --version || true # Print npm version or continue if not found
- name: Set PATH using environment file
run: |
echo '/home/azureuser/.nvm/versions/node/v20.10.0/bin' >> $GITHUB_PATH
- name: Deploy using SSH
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
port: 22
script: |
cd /home/azureuser/iconnect
git pull origin main
export NVM_DIR=~/.nvm
source ~/.nvm/nvm.sh
git status
pm2 kill
export NODE_ENV=production
cd server
npm install
npm run tsc
npm run start:prod