46 lines
1.1 KiB
YAML
46 lines
1.1 KiB
YAML
name: Build and deploy
|
|
run-name: ${{ gitea.actor }} is deploying Le Tribunal
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
paths:
|
|
- "src/**"
|
|
- "public/**"
|
|
- "package.json"
|
|
- "package-lock.json"
|
|
- "next.config.ts"
|
|
- "tsconfig.json"
|
|
- "tailwind.config.*"
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 22
|
|
|
|
- run: |
|
|
npm ci
|
|
npm rebuild lightningcss
|
|
|
|
- name: Build
|
|
run: |
|
|
npm run build
|
|
cp -r .next/static .next/standalone/.next/static
|
|
cp -r public .next/standalone/public
|
|
env:
|
|
NEXT_PUBLIC_SUPABASE_URL: ${{ secrets.SUPABASE_URL }}
|
|
NEXT_PUBLIC_SUPABASE_ANON_KEY: ${{ secrets.SUPABASE_ANON_KEY }}
|
|
|
|
- name: Deploy
|
|
run: |
|
|
tar -czf - -C .next/standalone . | \
|
|
curl -sf \
|
|
-H "X-Webhook-Secret: ${{ secrets.WEBHOOK_SECRET }}" \
|
|
-H "Content-Type: application/octet-stream" \
|
|
--data-binary @- \
|
|
"${{ secrets.DEPLOY_WEBHOOK }}"
|