Skip to content

Commit 92cf3fe

Browse files
authored
Merge pull request #20 from codesyntax/develop
storybook CI
2 parents a778b9c + 247e95a commit 92cf3fe

File tree

2 files changed

+52
-17
lines changed

2 files changed

+52
-17
lines changed

.github/workflows/release.yml

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,3 @@ jobs:
2727
env:
2828
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2929
NPM_TOKEN: ${{ secrets.NPM_TOKEN}}
30-
31-
build-and-deploy-sb:
32-
runs-on: ubuntu-latest
33-
if: github.event.pull_request.merged == true
34-
steps:
35-
- name: Checkout
36-
uses: actions/checkout@v2
37-
38-
- name: Install and Build
39-
run: |
40-
npm install
41-
npm run deploy-storybook
42-
43-
- name: Deploy
44-
with:
45-
branch: gh-pages
46-
folder: storybook-static # output folder from `npm run build-storybook`

.github/workflows/storybook.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Build & deploy
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
types: [closed]
8+
9+
jobs:
10+
build:
11+
name: Build
12+
runs-on: ubuntu-latest
13+
if: github.event.pull_request.merged == true
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v2
17+
18+
- name: Install Node.js
19+
uses: actions/setup-node@v1
20+
with:
21+
node-version: 13.x
22+
23+
- name: Install NPM packages
24+
run: npm ci
25+
26+
- name: Build project
27+
run: npm run build-storybook
28+
29+
- name: Upload production-ready build files
30+
uses: actions/upload-artifact@v2
31+
with:
32+
name: production-files
33+
path: ./storybook-static
34+
35+
deploy:
36+
name: Deploy
37+
needs: build
38+
runs-on: ubuntu-latest
39+
if: github.ref == 'refs/heads/main'
40+
41+
steps:
42+
- name: Download artifact
43+
uses: actions/download-artifact@v2
44+
with:
45+
name: production-files
46+
path: ./storybook-static
47+
48+
- name: Deploy to gh-pages
49+
uses: peaceiris/actions-gh-pages@v3
50+
with:
51+
github_token: ${{ secrets.GITHUB_TOKEN }}
52+
publish_dir: ./storybook-static

0 commit comments

Comments
 (0)