ota-tv-web/.gitea/workflows/deploy.yml
david dda3328667
All checks were successful
OTA TV / deploy (push) Successful in 7s
add install to deploy
2025-04-03 21:35:42 -07:00

43 lines
1.0 KiB
YAML

name: OTA TV
on:
push:
branches:
- main
jobs:
deploy:
runs-on: self-hosted
steps:
- name: Checkout code
run: |
cd ~/ota-tv-web
git fetch
git checkout main
git pull origin main
- name: Install dependencies
run: |
cd ~/ota-tv-web
if [ -f package-lock.json ] || [ -f package.json ]; then
echo "Installing npm dependencies..."
npm install
else
echo "No Node.js project found (missing package.json)"
exit 1
fi
- name: Stop existing screen session, if running
run: |
if screen -list | grep -q "ota_tv_web"; then
echo "Stopping existing screen session..."
screen -S ota_tv_web -X quit
fi
- name: Start server in screen session
run: |
cd ~/ota-tv-web
setsid screen -dmS ota_tv_web bash -c 'HTTP_PORT=8081 WS_PORT=3001 npm start > server.log 2>&1'
echo "Server started in detached screen session"