File tree Expand file tree Collapse file tree 2 files changed +54
-17
lines changed Expand file tree Collapse file tree 2 files changed +54
-17
lines changed Original file line number Diff line number Diff line change 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`
Original file line number Diff line number Diff line change 1+ name : Build & deploy
2+
3+ on :
4+ push :
5+ branches :
6+ - main
7+ pull_request :
8+ branches :
9+ - main
10+
11+ jobs :
12+ build :
13+ name : Build
14+ runs-on : ubuntu-latest
15+
16+ steps :
17+ - name : Checkout code
18+ uses : actions/checkout@v2
19+
20+ - name : Install Node.js
21+ uses : actions/setup-node@v1
22+ with :
23+ node-version : 13.x
24+
25+ - name : Install NPM packages
26+ run : npm ci
27+
28+ - name : Build project
29+ run : npm run build-storybook
30+
31+ - name : Upload production-ready build files
32+ uses : actions/upload-artifact@v2
33+ with :
34+ name : production-files
35+ path : ./storybook-static
36+
37+ deploy :
38+ name : Deploy
39+ needs : build
40+ runs-on : ubuntu-latest
41+ if : github.ref == 'refs/heads/main'
42+
43+ steps :
44+ - name : Download artifact
45+ uses : actions/download-artifact@v2
46+ with :
47+ name : production-files
48+ path : ./storybook-static
49+
50+ - name : Deploy to gh-pages
51+ uses : peaceiris/actions-gh-pages@v3
52+ with :
53+ github_token : ${{ secrets.GITHUB_TOKEN }}
54+ publish_dir : ./storybook-static
You can’t perform that action at this time.
0 commit comments