@@ -0,0 +1,35 @@
|
||||
name: Deploy Node App
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
|
||||
- name: Copy files to VPS
|
||||
uses: appleboy/scp-action@master
|
||||
with:
|
||||
host: ${{ secrets.VPS_HOST }}
|
||||
username: ${{ secrets.VPS_USER }}
|
||||
password: ${{ secrets.VPS_PASSWORD }}
|
||||
port: 22
|
||||
source: "./*"
|
||||
target: "/root/gyanBuddy"
|
||||
|
||||
|
||||
- name: Execute SSH Commands
|
||||
uses: appleboy/ssh-action@master
|
||||
with:
|
||||
host: ${{ secrets.VPS_HOST }}
|
||||
username: ${{ secrets.VPS_USER }}
|
||||
password: ${{ secrets.VPS_PASSWORD }}
|
||||
port: 22
|
||||
script: |
|
||||
cd /root/gyanBuddy
|
||||
npm install
|
||||
pm2 restart gyanBuddy
|
||||
Reference in New Issue
Block a user