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
          NEXTAUTH_URL: ${{ vars.NEXTAUTH_URL }}
          NEXTAUTH_SECRET: ${{ secrets.NEXTAUTH_SECRET }}
          PRISMA_DATA_PATH: ${{ vars.PRISMA_DATA_PATH }}
          UPLOADS_PATH: ${{ vars.UPLOADS_PATH }}
          POSTGRES_DATA_PATH: ${{ vars.POSTGRES_DATA_PATH }}
          POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }}
        run: |
          docker compose up -d --build
