-
Notifications
You must be signed in to change notification settings - Fork 37
62 lines (48 loc) · 1.65 KB
/
build-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
# This is a basic workflow to build and publish stripes-components storybook
name: Build and Publish Storybook
on:
push:
branches: [ "master" ]
jobs:
build-storybook:
env:
FOLIO_NPM_REGISTRY: 'https://repository.folio.org/repository/npm-folioci/'
NODEJS_VERSION: '18'
runs-on: ubuntu-latest
steps:
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODEJS_VERSION }}
check-latest: true
always-auth: true
- name: Set yarn config
run: yarn config set @folio:registry $FOLIO_NPM_REGISTRY
- name: Checkout
uses: actions/checkout@v3
- name: checkout storybook branch
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: sync storybook branch
run: |
git checkout storybook
git reset --hard origin/master
- name: Run yarn install
run: yarn install --ignore-scripts
- name: Build storybook
run: npm run storybook-build
# commit the build to history, clean the previous build, promote the new build (rename .out to docs)"
- name: Promote new storybook build to published build
run: |
git config user.name github-actions
git config user.email [email protected]
git add -f .out
git commit -am "added built storybook"
git pull origin storybook --rebase -Xours
rm -rf docs
git commit -am "clean hosted storybook"
git mv .out docs
git commit -am "update storybook"
- name: Publish storybook
run: git push origin storybook