-
Notifications
You must be signed in to change notification settings - Fork 53
Expand file tree
/
Copy pathdeploy-corbado-auth-example.yml
More file actions
51 lines (42 loc) · 1.64 KB
/
deploy-corbado-auth-example.yml
File metadata and controls
51 lines (42 loc) · 1.64 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
name: Deploy corbado_auth example to Vercel
env:
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID_CORBADO_AUTH_EXAMPLE }}
BRANCH_NAME_RAW: ${{ github.head_ref || github.ref_name }}
on:
push:
branches: [ main ]
pull_request:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Set up Node.js
uses: actions/setup-node@v5
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: "3.27.4"
- name: Normalize branch name
if: github.event_name == 'pull_request'
run: |
echo "BRANCH_NAME=$(echo $BRANCH_NAME_RAW | tr '/_' '-')" >> "$GITHUB_ENV"
shell: bash
- name: Deploy Next example to Vercel (Preview for PRs)
if: github.event_name == 'pull_request'
run: |
cd packages/corbado_auth/example
npx vercel pull --token $VERCEL_TOKEN --scope $VERCEL_ORG_ID
npx vercel build --token $VERCEL_TOKEN --scope $VERCEL_ORG_ID
url="$(npx vercel deploy --prebuilt -t ${{ secrets.VERCEL_TOKEN }})"
npx vercel alias -S corbado -t ${{ secrets.VERCEL_TOKEN }} "$url" $BRANCH_NAME.corbadoauth.flutter.corbado.io
- name: Deploy Next example to Vercel (Production on main)
if: github.event_name != 'pull_request'
run: |
cd packages/corbado_auth/example
npx vercel pull -t $VERCEL_TOKEN
npx vercel build --prod -t $VERCEL_TOKEN
npx vercel deploy --prebuilt --prod -t $VERCEL_TOKEN