From f0d5af522001ce0abdece4e93a9320608b2f1608 Mon Sep 17 00:00:00 2001 From: david Date: Thu, 3 Apr 2025 21:32:14 -0700 Subject: [PATCH] add gitea deploy --- .gitea/workflows/deploy.yml | 33 +++++++++++++++++++++++++++++++++ .vscode/settings.json | 3 +++ 2 files changed, 36 insertions(+) create mode 100644 .gitea/workflows/deploy.yml create mode 100644 .vscode/settings.json diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml new file mode 100644 index 0000000..9758d5c --- /dev/null +++ b/.gitea/workflows/deploy.yml @@ -0,0 +1,33 @@ +name: Personal Website - Run Python HTTP Server + +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: Stop existing screen session, if running + run: | + if screen -list | grep -q "ota_tv_web_server"; 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 + chmod +x ./start.sh + sassc css/style.scss css/style.css + 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" diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..55712c1 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "typescript.tsdk": "node_modules/typescript/lib" +} \ No newline at end of file