-
Notifications
You must be signed in to change notification settings - Fork 24
108 lines (97 loc) · 3.91 KB
/
deploy-react-sample-apps.yml
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
name: Deploy React Sample Apps
on:
push:
branches:
- main
paths:
- '.github/workflows/deploy-react-sample-apps.yml'
- 'sample-apps/react/**'
- '!packages/**' # avoid duplicated deployment if react-sdk also changed
pull_request:
types:
- opened
- synchronize
- reopened
paths:
- '.github/workflows/deploy-react-sample-apps.yml'
- 'sample-apps/react/**'
- 'packages/**'
- '!packages/react-native-sdk/**'
- '!**/docusaurus/**'
workflow_dispatch:
concurrency:
group: deploy-react-sample-apps-${{ github.ref }}
cancel-in-progress: true
jobs:
build-and-deploy-sample-apps:
name: Deploy ${{ matrix.application.name }}
timeout-minutes: 15
runs-on: ubuntu-latest
strategy:
matrix:
application:
- name: messenger-clone-react
project-id: prj_FNUiw2FtWJEDVHP5XttyLQmGw39n
populate-tokens: true
- name: zoom-clone-react
project-id: prj_y2GjsUXNvW7MdQ0EpJVG0FBNNovL
populate-tokens: true
- name: egress-composite
project-id: prj_R6DLpP2Gxc0aRHGEopQWE8tveNDX
- name: livestream-app-react
project-id: prj_uNJTw7DefSAntAoWCXwJaHc1khoA
- name: audio-rooms
project-id: prj_0WnHcvVkXpM4PRc2ymVmrAHFILoT
- name: react-dogfood - https://pronto.getstream.io
project-id: prj_4TTdjeVHEDhWWiFRfjIr1QFb5ell
- name: react-dogfood-staging - https://pronto-staging.getstream.io
project-id: prj_xmKoy4ExySCQ4fpWoWSVXlcuvtfS
- name: react-dogfood - https://getstream.io/video/demos
project-id: prj_tTLn3XMVal4D1Nnel9nPJ0hoI9wA
base-path: /video/demos
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ matrix.application.project-id }}
VITE_STREAM_USER_TOKEN: ${{ secrets.EGRESS_USER_TOKEN }}
VITE_STREAM_API_KEY: ${{ vars.STREAM_API_KEY_SAMPLE_APPS }}
VITE_STREAM_SECRET: ${{ secrets.STREAM_SECRET_SAMPLE_APPS }}
VITE_EGRESS_SENTRY_DNS: ${{ secrets.EGRESS_SENTRY_DNS }}
VITE_TOKEN_PROVIDER_URL: ${{secrets.TOKEN_PROVIDER_URL}}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN_PRONTO }}
PRONTO_SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN_PRONTO }}
EGRESS_SENTRY_AUTH_TOKEN: ${{ secrets.EGRESS_SENTRY_AUTH_TOKEN }}
MODE: ${{ github.ref_name == 'main' && 'production' || 'preview' }}
steps:
- uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22.x
cache: 'yarn'
- name: Install Dependencies
run: yarn install --immutable
- name: Populate tokens
if: ${{ matrix.application.populate-tokens }}
run: yarn workspace @stream-io/${{ matrix.application.name }} scripts:populate-tokens
- name: Build packages
env:
NODE_ENV: production
run: yarn build:react:deps
### Vercel deployment (Preview) ###
- name: Vercel Pull/Build/Deploy (Preview)
if: ${{ github.ref_name != 'main' }}
env:
NEXT_PUBLIC_BASE_PATH: ${{ matrix.application.base-path || '' }}
run: >
yarn vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }} &&
yarn vercel build --token=${{ secrets.VERCEL_TOKEN }} &&
yarn vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }}
### Vercel deployment (Production) ###
- name: Vercel Pull/Build/Deploy (Production)
if: ${{ github.ref_name == 'main' }}
env:
NEXT_PUBLIC_BASE_PATH: ${{ matrix.application.base-path || '' }}
run: >
yarn vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }} &&
yarn vercel build --prod --token=${{ secrets.VERCEL_TOKEN }} &&
yarn vercel deploy --prod --prebuilt --token=${{ secrets.VERCEL_TOKEN }}