-
Notifications
You must be signed in to change notification settings - Fork 1.8k
48 lines (44 loc) · 1.68 KB
/
v10-deploy-react-storybook.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
name: v10 - Deploy React storybook to GitHub Pages
on:
workflow_dispatch:
push:
tags:
# Matches tags that have the shape `v10.Y.Z`. Reference:
# https://help.github.com/en/articles/workflow-syntax-for-github-actions#onpushpull_requesttagsbranches
- 'v10.[0-9]+.[0-9]+'
# Ignore tags that use a preid after `vX.Y.Z`, for example: vX.Y.Z-alpha.0
# https://help.github.com/en/articles/workflow-syntax-for-github-actions#example-using-positive-and-negative-patterns
- '!v[0-9]+.[0-9]+.[0-9]+-*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js 16.x
uses: actions/setup-node@v3
with:
node-version: '16.x'
- name: Install dependencies
run: yarn install --immutable --immutable-cache
- name: Build project
run: yarn build
- name: Build static React storybook
run: |
cd packages/react
yarn build-storybook
- name: Create CNAME
run: |
touch packages/react/storybook-static/CNAME
echo "v7-react.carbondesignsystem.com" > packages/react/storybook-static/CNAME
- name: Push to v7 repo
uses: cpina/github-action-push-to-another-repository@main
env:
API_TOKEN_GITHUB: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
with:
source-directory: 'packages/react/storybook-static'
destination-github-username: 'carbon-design-system'
destination-repository-name: 'carbon-storybook-v7'
user-name: carbon-bot
user-email: [email protected]
target-branch: main
commit-message: 'chore(release): ${{ github.ref }}'