# Auto-Deploy: prüft den Code und stößt danach das Redeploy in Portainer an. # Braucht einen laufenden Act-Runner und das Repo-Secret PORTAINER_WEBHOOK # (Portainer → Stack → Webhook-URL). Siehe docs/auto-deploy.md. name: Deploy on: push: branches: [main] jobs: check: runs-on: ubuntu-latest steps: - name: Code holen uses: actions/checkout@v4 - name: Node einrichten uses: actions/setup-node@v4 with: node-version: '22' - name: Abhängigkeiten installieren run: npm ci - name: Server-Code prüfen run: | for f in $(find src -name "*.js"); do node --check "$f" || exit 1 done - name: Frontend bauen run: | cd frontend npm ci npm run build deploy: needs: check runs-on: ubuntu-latest steps: - name: Portainer-Redeploy auslösen run: | if [ -z "${{ secrets.PORTAINER_WEBHOOK }}" ]; then echo "PORTAINER_WEBHOOK ist nicht gesetzt — übersprungen." exit 0 fi code=$(curl -s -o /dev/null -w "%{http_code}" -X POST "${{ secrets.PORTAINER_WEBHOOK }}") echo "Portainer antwortete mit HTTP $code" [ "$code" -lt 400 ] || exit 1