name: Deploy with Docker Compose

on:
  push:
    branches:
      - main # adapte la branche que tu veux déployer

jobs:
  deploy:
    runs-on: mac-orbstack-runner # le nom que tu as donné au runner
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Deploy stack
        env:
          DOCKER_BUILDKIT: 1
          COMPOSE_DOCKER_CLI_BUILD: 1
          AUTH_SECRET: ${{ secrets.AUTH_SECRET }}
          DB_VOLUME_PATH: ${{ variables.DB_VOLUME_PATH }}
        run: |
          if [ -n "${DB_VOLUME_PATH}" ]; then mkdir -p "$DB_VOLUME_PATH"; fi
          docker compose up -d --build
