-
Notifications
You must be signed in to change notification settings - Fork 19
53 lines (44 loc) · 1.77 KB
/
storybook-publish.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
name: Deploy storybook to GitHub Pages
run-name: Publish Storybook
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
push:
branches:
- main
jobs:
deploy:
if: github.repository == 'carbon-design-system/carbon-labs'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'yarn'
- name: Install dependencies
run: yarn install
- name: Build
run: yarn build
- name: Build storybook for web-components
working-directory: 'packages/web-components'
run: yarn storybook:build
- name: Build storybook for react
working-directory: 'packages/react'
run: yarn storybook:build
# Deploy web-components Storybook Github Pages using `gh-pages` package
- name: Deploy web-components Storybook
run: |
git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
npx gh-pages -d packages/web-components/storybook-static -u "github-actions-bot <[email protected]>" --dest web-components --message "chore(deploy): deploy web-components storybook"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Deploy react Storybook Github Pages using `gh-pages` package
- name: Deploy react Storybook
run: |
git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
npx gh-pages -d packages/react/storybook-static -u "github-actions-bot <[email protected]>" --dest react --message "chore(deploy): deploy react storybook"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}