name: Deploy to Dev

on:
  push:
    branches: [main]

concurrency:
  group: deploy-dev
  cancel-in-progress: false

jobs:
  deploy:
    runs-on: self-hosted
    steps:
      - name: Pull latest into Dev webroot
        run: |
          set -euo pipefail
          cd /var/www/vhosts/dev.intelectra.de/httpdocs
          git fetch --prune origin
          git pull --ff-only origin main
          rm -rf tmp/smarty_compile/* tmp/smarty_cache/* 2>/dev/null || true
          echo "Deploy finished at $(date)"
