name: CI-CD on: push: branches: - "**" pull_request: jobs: bot-checks: name: Bot Lint Test Build runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - name: Setup Node uses: actions/setup-node@v4 with: node-version: "22" cache: npm - name: Install dependencies run: npm ci - name: Lint run: npm run lint - name: Build run: npm run build - name: Test run: npm run test dashboard-checks: name: Dashboard Lint Build runs-on: ubuntu-latest defaults: run: working-directory: admin-dashboard steps: - name: Checkout uses: actions/checkout@v4 - name: Setup Node uses: actions/setup-node@v4 with: node-version: "22" cache: npm cache-dependency-path: admin-dashboard/package-lock.json - name: Install dashboard dependencies run: npm ci - name: Lint dashboard run: npm run lint - name: Build dashboard run: npm run build deploy-coolify: name: Deploy to Coolify runs-on: ubuntu-latest needs: - bot-checks - dashboard-checks if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} steps: - name: Trigger Coolify deploy hook env: COOLIFY_DEPLOY_HOOK_URL: ${{ secrets.COOLIFY_DEPLOY_HOOK_URL }} COOLIFY_DEPLOY_TOKEN: ${{ secrets.COOLIFY_DEPLOY_TOKEN }} run: | if [ -z "$COOLIFY_DEPLOY_HOOK_URL" ]; then echo "Missing COOLIFY_DEPLOY_HOOK_URL secret" exit 1 fi if [ -n "$COOLIFY_DEPLOY_TOKEN" ]; then curl --fail --show-error --silent \ -X POST \ -H "Authorization: Bearer $COOLIFY_DEPLOY_TOKEN" \ "$COOLIFY_DEPLOY_HOOK_URL" else curl --fail --show-error --silent -X POST "$COOLIFY_DEPLOY_HOOK_URL" fi echo "Coolify deploy triggered"