name: Deploy
on:
  push:
    branches: [main]
    paths: ['products/02-iac-drift-detection/saas/**']

jobs:
  deploy-saas:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - uses: superfly/flyctl-actions/setup-flyctl@master

      - name: Deploy SaaS to Fly.io
        run: flyctl deploy --config fly.toml --remote-only
        working-directory: products/02-iac-drift-detection/saas
        env:
          FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
