-
Notifications
You must be signed in to change notification settings - Fork 25
77 lines (64 loc) · 2.11 KB
/
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
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
name: Build and Deploy Storybook
on:
pull_request:
branches:
- develop
- stage
- feat/user-page
types:
- labeled
jobs:
build-and-deploy-storybook:
if: ${{ github.event.label.name == 'storybook' }}
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@master
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '16.14'
cache: 'npm'
- name: Install Dependencies
run: npm ci
- name: Generate Types
if: github.base_ref == 'develop' || github.base_ref == 'feat/user-page'
run: npm run gen:type
- name: Lint
run: |
npm run i18n \
&& npm run lint \
&& npm run format:check
- name: Build
run: npm run build-storybook
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./storybook-static
destination_dir: ./storybook/${{ github.head_ref }}
keep_files: true
- name: Find Comment
uses: peter-evans/find-comment@v1
id: fc
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: 'github-actions[bot]'
body-includes: Storybook
- name: Create Comment
if: ${{ steps.fc.outputs.comment-id == 0 }}
uses: peter-evans/create-or-update-comment@v1
with:
issue-number: ${{ github.event.pull_request.number }}
body: |
🚀 Storybook has been deployed to GitHub Pages!
**URL**: https://thematters.github.io/matters-web/storybook/${{ github.head_ref }}
- name: Update comment
if: ${{ steps.fc.outputs.comment-id != 0 }}
uses: peter-evans/create-or-update-comment@v1
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
body: |
🚀 Storybook has been deployed to GitHub Pages!
**URL**: https://thematters.github.io/matters-web/storybook/${{ github.head_ref }}
edit-mode: replace