36 lines
855 B
YAML
36 lines
855 B
YAML
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/IR-Node-Setup"
|
|
|
|
|
|
- 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/IR-Node-Setup
|
|
npm install
|
|
pm2 restart IR-Node-Setup
|