forked from carbon-design-system/carbon-for-ibm-dotcom
-
Notifications
You must be signed in to change notification settings - Fork 0
287 lines (263 loc) · 10.5 KB
/
deploy-canary.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
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
name: deploy-canary (Deploy storybook environments to Github Pages)
on:
push:
branches:
- main
concurrency:
group: deploy-canary-${{ github.ref }}
cancel-in-progress: true
jobs:
carbon-web-components:
if: github.repository == 'carbon-design-system/carbon-for-ibm-dotcom'
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
with:
token: ${{secrets.MERGE_ACTION}}
- name: Use Node.js 18.x
uses: actions/setup-node@v4
with:
node-version: '18.x'
cache: 'yarn'
- name: Install dependencies
run: yarn install --immutable --immutable-cache
- name: Build project
run: yarn lerna run --scope @carbon/web-components build
- name: Set env vars
uses: ./.github/actions/set-dotenv
with:
env-file: packages/carbon-web-components/.env
env:
KALTURA_PARTNER_ID: ${{ secrets.KALTURA_PARTNER_ID }}
KALTURA_UICONF_ID: ${{ secrets.KALTURA_UICONF_ID }}
PROFILE_HOST: ${{ secrets.PROFILE_HOST }}
- name: Building @carbon/web-components storybook
run: yarn build-storybook
working-directory: packages/carbon-web-components
- name: Move storybook to build folder
run: |
rm packages/carbon-web-components/.env
mkdir -p builds
mv packages/carbon-web-components/storybook-static builds/carbon-web-components
- name: Deploying @carbon/web-components storybook to Github Pages
run: |
git config --global user.email ${{ secrets.BOT_EMAIL }}
git config --global user.name ${{ secrets.BOT_NAME }}
git fetch origin gh-pages
git checkout -b gh-pages origin/gh-pages
git update-ref -d refs/remotes/origin/gh-pages
git pull origin gh-pages
rm -rf canary/carbon-web-components
mkdir -p canary
mv builds/carbon-web-components canary/carbon-web-components
git add canary/carbon-web-components
git commit -m "chore(deploy): deploy Carbon web components canary to GitHub Pages"
git push origin gh-pages
- uses: act10ns/slack@v2
if: failure()
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
with:
status: ${{ job.status }}
web-components:
if: github.repository == 'carbon-design-system/carbon-for-ibm-dotcom'
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
with:
token: ${{secrets.MERGE_ACTION}}
- name: Use Node.js 18.x
uses: actions/setup-node@v4
with:
node-version: '18.x'
cache: 'yarn'
- name: Install dependencies
run: yarn install --immutable --immutable-cache
- name: Build project
run: yarn lerna run build
- name: Set env vars
uses: ./.github/actions/set-dotenv
with:
env-file: packages/web-components/.env
env:
KALTURA_PARTNER_ID: ${{ secrets.KALTURA_PARTNER_ID }}
KALTURA_UICONF_ID: ${{ secrets.KALTURA_UICONF_ID }}
PROFILE_HOST: ${{ secrets.PROFILE_HOST }}
- name: Building @carbon/ibmdotcom-web-components storybook
run: yarn build-storybook
working-directory: packages/web-components
- name: Move storybook to build folder
run: |
rm packages/web-components/.env
mkdir -p builds
mv packages/web-components/storybook-static builds/web-components
- name: Set env vars (RTL)
uses: ./.github/actions/set-dotenv
with:
env-file: packages/web-components/.env
env:
KALTURA_PARTNER_ID: ${{ secrets.KALTURA_PARTNER_ID }}
KALTURA_UICONF_ID: ${{ secrets.KALTURA_UICONF_ID }}
PROFILE_HOST: ${{ secrets.PROFILE_HOST }}
- name: Building @carbon/ibmdotcom-web-components RTL storybook
run: yarn build-storybook:rtl
working-directory: packages/web-components
- name: Move storybook to build folder
run: |
rm packages/web-components/.env
mv packages/web-components/storybook-static-rtl builds/web-components-rtl
- name: Set env vars (experimental)
uses: ./.github/actions/set-dotenv
with:
env-file: packages/web-components/.env
env:
KALTURA_PARTNER_ID: ${{ secrets.KALTURA_PARTNER_ID }}
KALTURA_UICONF_ID: ${{ secrets.KALTURA_UICONF_ID }}
PROFILE_HOST: ${{ secrets.PROFILE_HOST }}
C4D_FLAGS_ALL: true
- name: Building @carbon/ibmdotcom-web-components experimental storybook
run: yarn build-storybook:experimental
working-directory: packages/web-components
- name: Move storybook to build folder
run: |
rm packages/web-components/.env
mv packages/web-components/storybook-static-experimental builds/web-components-experimental
- name: Set env vars (react wrapper)
uses: ./.github/actions/set-dotenv
with:
env-file: packages/web-components/.env
env:
KALTURA_PARTNER_ID: ${{ secrets.KALTURA_PARTNER_ID }}
KALTURA_UICONF_ID: ${{ secrets.KALTURA_UICONF_ID }}
PROFILE_HOST: ${{ secrets.PROFILE_HOST }}
- name: Building @carbon/ibmdotcom-web-components react wrapper storybook
run: yarn build-storybook:react
working-directory: packages/web-components
- name: Move storybook to build folder
run: |
rm packages/web-components/.env
mv packages/web-components/storybook-static-react builds/web-components-react
- name: Deploying @carbon/ibmdotcom-web-components storybook to Github Pages
run: |
git config --global user.email ${{ secrets.BOT_EMAIL }}
git config --global user.name ${{ secrets.BOT_NAME }}
git fetch origin gh-pages
git checkout -b gh-pages origin/gh-pages
git update-ref -d refs/remotes/origin/gh-pages
git pull origin gh-pages
rm -rf canary/web-components
rm -rf canary/web-components-react
rm -rf canary/web-components-rtl
rm -rf canary/web-components-experimental
mkdir -p canary
mv builds/web-components canary/web-components
mv builds/web-components-react canary/web-components-react
mv builds/web-components-rtl canary/web-components-rtl
mv builds/web-components-experimental canary/web-components-experimental
git add canary/web-components
git add canary/web-components-react
git add canary/web-components-rtl
git add canary/web-components-experimental
git commit -m "chore(deploy): deploy Web Components canary to GitHub Pages"
git push origin gh-pages
- uses: act10ns/slack@v2
if: failure()
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
with:
status: ${{ job.status }}
services:
if: github.repository == 'carbon-design-system/carbon-for-ibm-dotcom'
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
with:
token: ${{secrets.MERGE_ACTION}}
- name: Use Node.js 18.x
uses: actions/setup-node@v4
with:
node-version: '18.x'
cache: 'yarn'
- name: Install dependencies
run: yarn install --immutable --immutable-cache
- name: Build project
run: yarn lerna run --ignore @carbon/ibmdotcom-web-components --ignore @carbon/web-components build
- name: Set env vars
uses: ./.github/actions/set-dotenv
with:
env-file: packages/services/.env
env:
KALTURA_PARTNER_ID: ${{ secrets.KALTURA_PARTNER_ID }}
KALTURA_UICONF_ID: ${{ secrets.KALTURA_UICONF_ID }}
PROFILE_HOST: ${{ secrets.PROFILE_HOST }}
- name: Building @carbon/ibmdotcom-services JSDocs
run: yarn jsdoc
working-directory: packages/services
- name: Deploying @carbon/ibmdotcom-services JSDocs to IBM Cloud
run: |
git config --global user.email ${{ secrets.BOT_EMAIL }}
git config --global user.name ${{ secrets.BOT_NAME }}
mkdir -p builds
mv packages/services/docs builds/services
git fetch origin gh-pages
git checkout -b gh-pages origin/gh-pages
git update-ref -d refs/remotes/origin/gh-pages
git pull origin gh-pages
rm -rf services
mv builds/services services
git add services
git commit -m "chore(deploy): deploy Services to GitHub Pages"
git push origin gh-pages
- uses: act10ns/slack@v2
if: failure()
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
with:
status: ${{ job.status }}
utilities:
if: github.repository == 'carbon-design-system/carbon-for-ibm-dotcom'
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
with:
token: ${{secrets.MERGE_ACTION}}
- name: Use Node.js 18.x
uses: actions/setup-node@v4
with:
node-version: '18.x'
cache: 'yarn'
- name: Install dependencies
run: yarn install --immutable --immutable-cache
- name: Build project
run: yarn lerna run --scope @carbon/ibmdotcom-utilities build
- name: Set env vars
uses: ./.github/actions/set-dotenv
with:
env-file: packages/utilities/.env
env:
KALTURA_PARTNER_ID: ${{ secrets.KALTURA_PARTNER_ID }}
KALTURA_UICONF_ID: ${{ secrets.KALTURA_UICONF_ID }}
- name: Building @carbon/ibmdotcom-utilities JSDocs
run: yarn jsdoc
working-directory: packages/utilities
- name: Deploying @carbon/ibmdotcom-utilities JSDocs to IBM Cloud
run: |
git config --global user.email ${{ secrets.BOT_EMAIL }}
git config --global user.name ${{ secrets.BOT_NAME }}
mkdir -p builds
mv packages/utilities/docs builds/utilities
git fetch origin gh-pages
git checkout -b gh-pages origin/gh-pages
git update-ref -d refs/remotes/origin/gh-pages
git pull origin gh-pages
rm -rf utilities
mv builds/utilities utilities
git add utilities
git commit -m "chore(deploy): deploy Utilities to GitHub Pages"
git push origin gh-pages
- uses: act10ns/slack@v2
if: failure()
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
with:
status: ${{ job.status }}