-
Notifications
You must be signed in to change notification settings - Fork 0
216 lines (214 loc) · 10 KB
/
deploy.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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
name: Deploy
on:
workflow_dispatch:
push:
branches:
- 'main'
jobs:
deploy-auth-service:
name: Deploy services/auth
timeout-minutes: 15
runs-on: ubuntu-latest
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
TURBO_REMOTE_ONLY: true
steps:
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 2
- uses: pnpm/action-setup@v2
with:
version: 7.26.3
- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: 16
cache: 'pnpm'
- name: Load secrets
uses: 1password/load-secrets-action@v1
with:
# Export loaded secrets as environment variables
export-env: true
env:
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
# contentful
NEXT_PUBLIC_CONTENTFUL_SPACE_ID: op://k33-web-env/prod/contentful/SPACE_ID
NEXT_PUBLIC_CONTENTFUL_ACCESS_TOKEN: op://k33-web-env/prod/contentful/ACCESS_TOKEN
NEXT_PUBLIC_CONTENTFUL_PREVIEW_ACCESS_TOKEN: op://k33-web-env/prod/contentful/PREVIEW_ACCESS_TOKEN
NEXT_PUBLIC_CONTENTFUL_PREVIEW_SECRET: op://k33-web-env/prod/contentful/PREVIEW_SECRET
NEXT_PUBLIC_CONTENTFUL_ENVIRONMENT: op://k33-web-env/prod/contentful/ENVIRONMENT
NEXT_PUBLIC_CONTENTFUL_GRAPHQL_ENDPOINT: op://k33-web-env/prod/contentful/GRAPHQL_ENDPOINT
NEXT_PUBLIC_CONTENTFUL_ARCHIVE_SPACE_ID: op://k33-web-env/prod/contentful/ARCHIVE_SPACE_ID
NEXT_PUBLIC_CONTENTFUL_ARCHIVE_ACCESS_TOKEN: op://k33-web-env/prod/contentful/ARCHIVE_ACCESS_TOKEN
# firebase app settings
NEXT_PUBLIC_FIREBASE_API_KEY: op://k33-web-env/prod/firebase/API_KEY
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN: op://k33-web-env/prod/firebase/AUTH_DOMAIN
NEXT_PUBLIC_FIREBASE_PROJECT_ID: op://k33-web-env/prod/firebase/PROJECT_ID
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET: op://k33-web-env/prod/firebase/STORAGE_BUCKET
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID: op://k33-web-env/prod/firebase/MESSAGING_SENDER_ID
NEXT_PUBLIC_FIREBASE_APP_ID: op://k33-web-env/prod/firebase/APP_ID
NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID: op://k33-web-env/prod/firebase/MEASUREMENT_ID
FIREBASE_SERVICE_ACCOUNT: op://k33-web-env/prod/firebase/SERVICE_ACCOUNT
# google
NEXT_PUBLIC_GOOGLE_ID: op://k33-web-env/prod/google/ID
NEXT_PUBLIC_GOOGLE_SECRET: op://k33-web-env/prod/google/SECRET
# domains
NEXT_PUBLIC_WEB_DOMAIN: op://k33-web-env/prod/domain/WEB
NEXT_PUBLIC_API_DOMAIN: op://k33-web-env/prod/domain/API
- name: Install dependencies
run: pnpm install
- name: Build local dependencies
run: pnpm --dir packages/ui build
- name: export services/auth
run: pnpm --dir apps/auth export
- name: deploy services/auth
uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ env.FIREBASE_SERVICE_ACCOUNT }}'
expires: 30d
projectId: '${{ env.NEXT_PUBLIC_FIREBASE_PROJECT_ID }}'
channelId: live
# removing target will deploy all targets defined in .firebaserc
target: 'k33-auth'
deploy-research-app:
name: Deploy research
timeout-minutes: 15
runs-on: ubuntu-latest
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
TURBO_REMOTE_ONLY: true
steps:
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 2
- uses: pnpm/action-setup@v2
with:
version: 7.26.3
- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: 16
cache: 'pnpm'
- name: Load secrets
uses: 1password/load-secrets-action@v1
with:
# Export loaded secrets as environment variables
export-env: true
env:
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
# contentful
NEXT_PUBLIC_CONTENTFUL_SPACE_ID: op://k33-web-env/prod/contentful/SPACE_ID
NEXT_PUBLIC_CONTENTFUL_ACCESS_TOKEN: op://k33-web-env/prod/contentful/ACCESS_TOKEN
NEXT_PUBLIC_CONTENTFUL_PREVIEW_ACCESS_TOKEN: op://k33-web-env/prod/contentful/PREVIEW_ACCESS_TOKEN
NEXT_PUBLIC_CONTENTFUL_PREVIEW_SECRET: op://k33-web-env/prod/contentful/PREVIEW_SECRET
NEXT_PUBLIC_CONTENTFUL_ENVIRONMENT: op://k33-web-env/prod/contentful/ENVIRONMENT
NEXT_PUBLIC_CONTENTFUL_GRAPHQL_ENDPOINT: op://k33-web-env/prod/contentful/GRAPHQL_ENDPOINT
NEXT_PUBLIC_CONTENTFUL_ARCHIVE_SPACE_ID: op://k33-web-env/prod/contentful/ARCHIVE_SPACE_ID
NEXT_PUBLIC_CONTENTFUL_ARCHIVE_ACCESS_TOKEN: op://k33-web-env/prod/contentful/ARCHIVE_ACCESS_TOKEN
# firebase app settings
NEXT_PUBLIC_FIREBASE_API_KEY: op://k33-web-env/prod/firebase/API_KEY
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN: op://k33-web-env/prod/firebase/AUTH_DOMAIN
NEXT_PUBLIC_FIREBASE_PROJECT_ID: op://k33-web-env/prod/firebase/PROJECT_ID
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET: op://k33-web-env/prod/firebase/STORAGE_BUCKET
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID: op://k33-web-env/prod/firebase/MESSAGING_SENDER_ID
NEXT_PUBLIC_FIREBASE_APP_ID: op://k33-web-env/prod/firebase/APP_ID
NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID: op://k33-web-env/prod/firebase/MEASUREMENT_ID
FIREBASE_SERVICE_ACCOUNT: op://k33-web-env/prod/firebase/SERVICE_ACCOUNT
# google
NEXT_PUBLIC_GOOGLE_ID: op://k33-web-env/prod/google/ID
NEXT_PUBLIC_GOOGLE_SECRET: op://k33-web-env/prod/google/SECRET
# domains
NEXT_PUBLIC_WEB_DOMAIN: op://k33-web-env/prod/domain/WEB
NEXT_PUBLIC_API_DOMAIN: op://k33-web-env/prod/domain/API
#algolia
NEXT_PUBLIC_ALGOLIA_APP_ID: op://k33-web-env/prod/algolia/APP_ID
NEXT_PUBLIC_ALGOLIA_SEARCH_API_KEY: op://k33-web-env/prod/algolia/SEARCH_API_KEY
- name: Install dependencies
run: pnpm install
- name: Build local dependencies
run: pnpm --dir packages/ui build
- name: export research
run: pnpm --dir apps/research export
- name: deploy research
uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ env.FIREBASE_SERVICE_ACCOUNT }}'
expires: 30d
projectId: '${{ env.NEXT_PUBLIC_FIREBASE_PROJECT_ID }}'
channelId: live
# removing target will deploy all targets defined in .firebaserc
target: 'k33-research'
deploy-invest-app:
name: Deploy invest
timeout-minutes: 15
runs-on: ubuntu-latest
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
TURBO_REMOTE_ONLY: true
steps:
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 2
- uses: pnpm/action-setup@v2
with:
version: 7.26.3
- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: 16
cache: 'pnpm'
- name: Load secrets
uses: 1password/load-secrets-action@v1
with:
# Export loaded secrets as environment variables
export-env: true
env:
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
# contentful
NEXT_PUBLIC_CONTENTFUL_SPACE_ID: op://k33-web-env/prod/contentful/SPACE_ID
NEXT_PUBLIC_CONTENTFUL_ACCESS_TOKEN: op://k33-web-env/prod/contentful/ACCESS_TOKEN
NEXT_PUBLIC_CONTENTFUL_PREVIEW_ACCESS_TOKEN: op://k33-web-env/prod/contentful/PREVIEW_ACCESS_TOKEN
NEXT_PUBLIC_CONTENTFUL_PREVIEW_SECRET: op://k33-web-env/prod/contentful/PREVIEW_SECRET
NEXT_PUBLIC_CONTENTFUL_ENVIRONMENT: op://k33-web-env/prod/contentful/ENVIRONMENT
NEXT_PUBLIC_CONTENTFUL_GRAPHQL_ENDPOINT: op://k33-web-env/prod/contentful/GRAPHQL_ENDPOINT
NEXT_PUBLIC_CONTENTFUL_ARCHIVE_SPACE_ID: op://k33-web-env/prod/contentful/ARCHIVE_SPACE_ID
NEXT_PUBLIC_CONTENTFUL_ARCHIVE_ACCESS_TOKEN: op://k33-web-env/prod/contentful/ARCHIVE_ACCESS_TOKEN
# firebase app settings
NEXT_PUBLIC_FIREBASE_API_KEY: op://k33-web-env/prod/firebase/API_KEY
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN: op://k33-web-env/prod/firebase/AUTH_DOMAIN
NEXT_PUBLIC_FIREBASE_PROJECT_ID: op://k33-web-env/prod/firebase/PROJECT_ID
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET: op://k33-web-env/prod/firebase/STORAGE_BUCKET
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID: op://k33-web-env/prod/firebase/MESSAGING_SENDER_ID
NEXT_PUBLIC_FIREBASE_APP_ID: op://k33-web-env/prod/firebase/APP_ID
NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID: op://k33-web-env/prod/firebase/MEASUREMENT_ID
FIREBASE_SERVICE_ACCOUNT: op://k33-web-env/prod/firebase/SERVICE_ACCOUNT
# google
NEXT_PUBLIC_GOOGLE_ID: op://k33-web-env/prod/google/ID
NEXT_PUBLIC_GOOGLE_SECRET: op://k33-web-env/prod/google/SECRET
# domains
NEXT_PUBLIC_WEB_DOMAIN: op://k33-web-env/prod/domain/WEB
NEXT_PUBLIC_API_DOMAIN: op://k33-web-env/prod/domain/API
- name: Install dependencies
run: pnpm install
- name: Build local dependencies
run: pnpm --dir packages/ui build
- name: export invest
run: pnpm --dir apps/invest export
- name: deploy invest
uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ env.FIREBASE_SERVICE_ACCOUNT }}'
expires: 30d
projectId: '${{ env.NEXT_PUBLIC_FIREBASE_PROJECT_ID }}'
channelId: live
# removing target will deploy all targets defined in .firebaserc
target: 'k33-invest'