Files
1bis8/.gitea/workflows/deploy.yml
T
Kimi Work c25293e03d
Build & Deploy / deploy (push) Successful in 18s
CI: Game-API per Bind-Mount deployen + Selbst-Neustart der API
- deploy.yml kopiert server.js auf den VPS; API beobachtet mtime und
  startet bei Aenderung selbst neu (Restart-Policy)
2026-10-10 19:16:35 +02:00

46 lines
1.4 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
name: Build & Deploy
# Fährt automatisch bei jedem Push auf main aus:
# Abhängigkeiten → Build → dist/ auf den VPS kopieren → Health-Check.
# Das dist/-Verzeichnis ist auf dem Web-Container als Laufzeit-Mount
# eingebunden (/opt/1bis8/web/dist), nginx pickt neue Dateien sofort auf.
on:
push:
branches: [main]
jobs:
deploy:
runs-on: docker
container:
image: node:22-alpine
# /opt/1bis8 des Hosts steht im Job als /deploy bereit (Whitelist im Runner)
options: -v /opt/1bis8:/deploy
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Abhängigkeiten installieren
run: cd app && npm ci
- name: Build
run: cd app && npm run build
- name: Deploy auf 1bis.hocks.eu
run: |
rm -rf /deploy/web/dist/*
cp -a app/dist/. /deploy/web/dist/
# Game-API laeuft per Bind-Mount (compose: ./game/api/server.js:/app/server.js).
# Die API beobachtet ihre eigene Datei und startet sich bei Aenderung selbst neu.
- name: Game-API-Code auf den VPS kopieren
run: cp server/game/api/server.js /deploy/game/api/server.js
- name: Health-Check
run: |
apk add --no-cache curl
sleep 3
curl -sf https://1bis.hocks.eu/ > /dev/null
curl -sf https://1bis8.hocks.eu/ > /dev/null
echo "1 bis 8 Party antwortet – Deploy erfolgreich"