+16
-10
@@ -1,29 +1,35 @@
|
|||||||
name: Deploy Node App
|
name: Deploy Node App
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy:
|
deploy:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Deploy to VPS
|
- name: Checkout Code
|
||||||
uses: appleboy/ssh-action@master
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
# Step 1: Pehle local files ko server par copy karein
|
||||||
|
- name: Copy files to VPS
|
||||||
|
uses: appleboy/scp-action@master
|
||||||
with:
|
with:
|
||||||
host: 172.237.44.156
|
host: 172.237.44.156
|
||||||
username: root
|
username: root
|
||||||
password: LinodeUser#26
|
password: LinodeUser#26
|
||||||
port: 22
|
port: 22
|
||||||
|
source: "./*"
|
||||||
|
target: "/root/IR-Node-Setup"
|
||||||
|
|
||||||
|
# Step 2: Server par commands run karein (Bina git pull ke)
|
||||||
|
- name: Execute SSH Commands
|
||||||
|
uses: appleboy/ssh-action@master
|
||||||
|
with:
|
||||||
|
host: 172.237.44.156
|
||||||
|
username: root
|
||||||
|
password: LinodeUser#26
|
||||||
|
port: 22
|
||||||
script: |
|
script: |
|
||||||
cd /root/IR-Node-Setup
|
cd /root/IR-Node-Setup
|
||||||
|
|
||||||
git pull origin main
|
|
||||||
|
|
||||||
npm install
|
npm install
|
||||||
|
pm2 restart IR-Node-Setup
|
||||||
pm2 restart IR-Node-Setup
|
|
||||||
|
|||||||
Reference in New Issue
Block a user