forked from carbon-design-system/carbon-for-ibm-dotcom
-
Notifications
You must be signed in to change notification settings - Fork 0
98 lines (88 loc) · 3.38 KB
/
Copy pathdeploy-next.yml
File metadata and controls
98 lines (88 loc) · 3.38 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
name: deploy-next (Deploy storybook environments to Github Pages)
on:
push:
branches:
- release/v2*
concurrency:
group: deploy-next-${{ github.ref }}
cancel-in-progress: true
jobs:
web-components:
if: github.repository == 'carbon-design-system/carbon-for-ibm-dotcom'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
token: ${{secrets.MERGE_ACTION}}
- name: Use Node.js 18.x
uses: actions/setup-node@v6
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 (next) 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 (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 }}
C4D_FLAGS_ALL: true
- name: Deploying @carbon/ibmdotcom-web-components (next) 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 next/web-components
rm -rf next/web-components-rtl
mkdir -p next
mv builds/web-components next/web-components
mv builds/web-components-rtl next/web-components-rtl
git add next/web-components
git add next/web-components-rtl
git commit -m "chore(deploy): deploy Web Components next 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 }}