name: Deploy Production on: push: branches: [main] jobs: deploy: runs-on: ubuntu-latest steps: - name: Deploy and verify 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 docker compose up -d --wait curl -sf http://localhost:8004/api/health && echo "✓ PROD API /api/health OK" curl -sf http://localhost:3004/api/health && echo "✓ PROD Frontend-Proxy /api/health OK" docker compose exec -T backend pip install -q -r requirements-dev.txt docker compose exec -T backend python -m pytest tests -ra -vv --tb=short echo "✓ PROD pytest OK" if command -v k6 >/dev/null 2>&1; then BASE_URL=http://localhost:8004 k6 run scripts/load/k6-health-baseline.js echo "✓ PROD k6 OK" else echo "(k6 nicht installiert — Health bereits via curl geprüft)" fi if command -v node >/dev/null 2>&1; then npm install --no-audit --no-fund npx playwright install --with-deps chromium PLAYWRIGHT_BASE_URL=http://localhost:3004 npx playwright test tests/smoke-health.spec.js echo "✓ PROD Playwright smoke OK" else echo "(Node nicht verfügbar — Playwright übersprungen)" fi echo "=== Kairo PROD Deploy complete ==="