mirror of
https://gitlab.com/vyla-entertainment/live.git
synced 2026-11-09 19:57:22 -05:00
33 lines
731 B
YAML
33 lines
731 B
YAML
name: Deploy to VPS
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Deploy via SSH
|
|
uses: appleboy/ssh-action@v1.2.0
|
|
with:
|
|
host: ${{ secrets.VPS_HOST }}
|
|
username: root
|
|
key: ${{ secrets.SSH_PRIVATE_KEY }}
|
|
script: |
|
|
cd /var/www/live-api-streampk
|
|
|
|
git fetch origin main
|
|
git reset --hard origin/main
|
|
git clean -fd
|
|
|
|
npm install
|
|
|
|
chown -R www-data:www-data /var/www/live-api-streampk
|
|
chmod -R 755 /var/www/live-api-streampk
|
|
|
|
pm2 restart live-api-streampk || pm2 start server.js --name live-api-streampk
|
|
|
|
pm2 save |