-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (56 loc) · 1.66 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
name: Build and Deploy
on:
pull_request:
branches:
- main
push:
paths: ["stories/**", "src/components/**", ".github/workflows/storybook.yml", "package.json", "webpack.entries.js"] # Trigger the action only when files change in the folders defined here
branches: ["main"]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
permissions:
contents: write
pages: write
id-token: write
# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
build:
concurrency: ci-${{ github.ref }} # Recommended if you intend to make multiple deployments in quick succession.
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3
with:
persist-credentials: false
- name: Set Yarn Version
run: yarn set version berry
- name: Install Dependencies
run: yarn install
- name: Lint with ESLint and stylelint
run: yarn run lint:check
- name: Build Storybook
run: |
yarn run build-storybook
mv docs-build _site
- name: Build bundle
run: |
yarn run build
cp dist _site -r
- name: Run tests with Jest 🧪
run: |
yarn test
- name: Cache Jest cache
uses: actions/cache@v2
with:
path: "**/node_modules/.cache/jest"
key: jest-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
jest-${{ runner.os }}-
- name: Archive production artifacts
uses: actions/upload-artifact@v4
with:
name: output
path: ./dist