name: "Deploy to Netlify"

on:
  push:
    branches:
      - main

jobs:
  deploy:
    name: "Deploy to Netlify"
    steps:
      - uses: actions/checkout@v4
        name: Checkout
      - name: Build
        env:
          VITE_SUPPORT_EMAIL: ${{ secrets.VITE_SUPPORT_EMAIL }}
          VITE_API_URL: ${{ secrets.VITE_API_URL }}
          VITE_TURNSTILE_SITE_KEY: ${{ secrets.VITE_TURNSTILE_SITE_KEY }}
        run: |
          npm --version && node --version
          npm i -g pnpm
          pnpm install
          pnpm build

      - name: Deploy to Netlify
        run: pnpm run deploy
        env:
          NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
          NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
