-
Notifications
You must be signed in to change notification settings - Fork 5
50 lines (44 loc) · 1.35 KB
/
storybook.yaml
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
name: 'Publish Storybook to Chromatic'
on:
push:
branches: main
pull_request:
branches: main
jobs:
publish-storybook-to-chromatic:
runs-on: ubuntu-latest
permissions: write-all
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
# setup-node의 pnpm 지원을 위한 Action
- uses: pnpm/action-setup@v4
with:
version: 8.15.1
- uses: actions/setup-node@v4
with:
node-version: 18
cache: 'pnpm'
- run: pnpm install
- uses: chromaui/action@v1
with:
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
token: ${{ secrets.GITHUB_TOKEN }}
exitZeroOnChanges: true
env:
STORYBOOK_API_BASE_URL: ${{ vars.STORYBOOK_API_BASE_URL }}
id: chromatic
- uses: actions/github-script@v7
if: github.event_name == 'pull_request'
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const url = `${{ steps.chromatic.outputs.storybookUrl }}`;
const message = `🚀 Storybook is deployed! View it here: ${url}`;
const prNumber = context.payload.pull_request.number;
github.rest.issues.createComment({
...context.repo,
issue_number: prNumber,
body: message
});