Files
GSM/.gitea/workflows/deploy.yml
Alexander Zielonka 2d9a5910fa
All checks were successful
Deploy GSM / deploy (push) Successful in 1m25s
Cleanup repo, add Gitea CI/CD workflow, improve error handling
- Remove temp files and reorganize docs
- Add .gitea/workflows/deploy.yml for automated deployment
- Add unreachable host checks to server routes (/:id, logs, start/stop/restart)
- Add unreachable checks to config routes (zomboid, terraria, openttd)
- Return HTTP 503 with unreachable flag instead of crashing

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 12:15:32 +01:00

64 lines
1.5 KiB
YAML

name: Deploy GSM
on:
push:
branches: [main]
paths:
- 'gsm-backend/**'
- 'gsm-frontend/**'
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install backend dependencies
run: |
cd gsm-backend
npm ci --production
- name: Install frontend dependencies and build
run: |
cd gsm-frontend
npm ci
npm run build
- name: Deploy Backend
uses: appleboy/scp-action@v0.1.7
with:
host: 192.168.2.30
username: root
key: ${{ secrets.SSH_DEPLOY_KEY }}
source: "gsm-backend/"
target: "/opt/gameserver-monitor/"
strip_components: 1
- name: Deploy Frontend
uses: appleboy/scp-action@v0.1.7
with:
host: 192.168.2.30
username: root
key: ${{ secrets.SSH_DEPLOY_KEY }}
source: "gsm-frontend/dist/"
target: "/opt/gameserver-monitor/frontend/"
strip_components: 2
- name: Restart Services
uses: appleboy/ssh-action@v1.0.3
with:
host: 192.168.2.30
username: root
key: ${{ secrets.SSH_DEPLOY_KEY }}
script: |
cd /opt/gameserver-monitor
pm2 restart gsm-backend || pm2 start backend/server.js --name gsm-backend
echo "Deploy complete!"