File tree Expand file tree Collapse file tree 2 files changed +52
-17
lines changed Expand file tree Collapse file tree 2 files changed +52
-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+ 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
You can’t perform that action at this time.
0 commit comments