-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (54 loc) · 1.73 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
name: Storybook - Install, Lint, Build and GitHub Pages Deploy
on:
push:
branches: main
pull_request:
paths:
- 'storybook/**'
- '!examples/**'
- '!packages/react/**'
- '!packages/sdk/**'
- '!packages/ui/**'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
with:
ref: ${{ github.head_ref }}
- name: Setup Node version
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b
with:
node-version-file: '.nvmrc' # Root of the repository.
- name: Install dependencies
run: npm ci --ignore-scripts
- name: Build packages
run: npm run build
- name: Lint check
run: npm run lint
- name: Install and Build Storybook
run: cd storybook/ && npm install && npm run build-storybook
# We upload the artifact and deploy to GitHub Pages only when this workflow is manually triggered.
- name: Upload pages artifact
if: ${{ github.event_name == 'workflow_dispatch' }}
id: upload-pages-artifact
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa
with:
name: storybook
path: storybook/storybook-static/
retention-days: 90
deploy:
needs: build
if: ${{ github.event_name == 'workflow_dispatch' }}
runs-on: ubuntu-22.04
permissions:
id-token: write
pages: write
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e
with:
artifact_name: storybook