-
Notifications
You must be signed in to change notification settings - Fork 2
77 lines (68 loc) · 2.62 KB
/
Copy pathdeploy-cloud.yml
File metadata and controls
77 lines (68 loc) · 2.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: Deploy paycraft.mobilebytesensei.com
on:
push:
branches: [main]
workflow_dispatch:
inputs:
dry_run:
description: 'Dry run (no actual deploy)'
type: boolean
default: false
concurrency:
group: deploy-cloud
cancel-in-progress: false
jobs:
deploy-dashboard:
name: Deploy Next.js dashboard to Vercel
runs-on: ubuntu-latest
if: github.event.inputs.dry_run != 'true'
steps:
- uses: actions/checkout@v4
# The dashboard is a STANDALONE Next.js app under dashboard/ — NOT a pnpm
# workspace (no root pnpm-lock.yaml / pnpm-workspace.yaml), so a root
# `pnpm install --frozen-lockfile` and `pnpm --filter dashboard` cannot
# work. Vercel builds the app remotely (project Root Directory = dashboard),
# so there is no local install/build step here — we only trigger the deploy.
# working-directory MUST be the repo root: the Vercel project already
# appends Root Directory=dashboard, so pointing the action at dashboard/
# would resolve to dashboard/dashboard and fail.
- name: Deploy to Vercel (production)
uses: amondnet/vercel-action@v25
with:
vercel-token: ${{ secrets.VERCEL_TOKEN }}
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
vercel-args: '--prod'
working-directory: .
deploy-functions:
name: Deploy Supabase edge functions
runs-on: ubuntu-latest
if: github.event.inputs.dry_run != 'true'
steps:
- uses: actions/checkout@v4
- uses: supabase/setup-cli@v1
with:
version: latest
- name: Deploy core functions
run: |
supabase functions deploy v2-config \
--project-ref ${{ secrets.SUPABASE_PROD_REF }}
supabase functions deploy v2-billing \
--project-ref ${{ secrets.SUPABASE_PROD_REF }}
supabase functions deploy stripe-connect-oauth \
--project-ref ${{ secrets.SUPABASE_PROD_REF }}
env:
SUPABASE_ACCESS_TOKEN: ${{ secrets.SUPABASE_ACCESS_TOKEN }}
- name: Deploy webhook handlers
run: |
for fn in stripe razorpay paddle paypal lemon-squeezy flutterwave paystack midtrans btcpay; do
supabase functions deploy "${fn}-webhook" \
--project-ref ${{ secrets.SUPABASE_PROD_REF }}
done
env:
SUPABASE_ACCESS_TOKEN: ${{ secrets.SUPABASE_ACCESS_TOKEN }}
smoke:
name: Run production smoke tests
needs: [deploy-dashboard, deploy-functions]
uses: ./.github/workflows/cloud-smoke.yml
secrets: inherit