name: Deploy Production on: push: branches: [main] jobs: deploy: runs-on: ubuntu-latest steps: - name: Deploy to Production run: | set -e echo "=== Deploying Kairo to PRODUCTION ===" REPO="http://192.168.2.144:3000/Lars/Kairo-Jinkendo.git" TARGET="/home/lars/docker/kairo" mkdir -p "$TARGET" cd "$TARGET" if [ ! -d .git ]; then git clone -b main "$REPO" . else git fetch origin main git checkout main git reset --hard origin/main fi docker compose build --no-cache backend frontend echo "✓ Backend + Frontend gebaut (Frontend: npm run build im Dockerfile)" if ! docker compose up -d --wait; then echo "✗ compose up --wait fehlgeschlagen — Backend-Logs:" docker compose logs backend --tail 150 || true docker compose ps || true exit 1 fi if ! curl -sf http://localhost:8004/api/health; then echo "✗ PROD API nicht erreichbar — Backend-Logs:" docker compose logs backend --tail 150 || true exit 1 fi echo "✓ PROD API /api/health OK" curl -sf http://localhost:3004/api/health && echo "✓ PROD Frontend-Proxy /api/health OK" echo "=== Kairo PROD Deploy complete ==="