File tree 3 files changed +39
-17
lines changed
3 files changed +39
-17
lines changed Original file line number Diff line number Diff line change
1
+ # .github/workflows/preview.yml
2
+ name : Deploy PR previews
3
+
4
+ on :
5
+ pull_request :
6
+ types :
7
+ - opened
8
+ - reopened
9
+ - synchronize
10
+ - closed
11
+
12
+ concurrency : preview-${{ github.ref }}
13
+
14
+ jobs :
15
+ deploy-preview :
16
+ runs-on : ubuntu-latest
17
+ steps :
18
+ - name : Checkout
19
+ uses : actions/checkout@v4
20
+
21
+ - name : Install and Build
22
+ if : github.event.action != 'closed' # You might want to skip the build if the PR has been closed
23
+ run : |
24
+ npm install
25
+ npm run build-storybook
26
+
27
+ - name : Deploy preview
28
+ uses : rossjrw/pr-preview-action@v1
29
+ with :
30
+ source-dir : ./storybook-static/
31
+ preview-branch : gh-pages
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ concurrency:
23
23
24
24
jobs :
25
25
# Build job
26
- build :
26
+ deploy :
27
27
runs-on : ubuntu-latest
28
28
steps :
29
29
- name : Checkout
34
34
run : |
35
35
npm install
36
36
npm run build-storybook
37
- - name : Upload artifact
38
- uses : actions/upload-pages-artifact@v3
37
+ - uses : JamesIves/github-pages-deploy-action@v4
39
38
with :
40
- path : storybook-static/
41
-
42
- # Deployment job
43
- deploy :
44
- environment :
45
- name : github-pages
46
- url : ${{ steps.deployment.outputs.page_url }}
47
- runs-on : ubuntu-latest
48
- needs : build
49
- steps :
50
- - name : Deploy to GitHub Pages
51
- id : deployment
52
- uses : actions/deploy-pages@v4
39
+ folder : ./storybook-static/
40
+ branch : gh-pages
41
+ clean-exclude : pr-preview
42
+ force : false
Original file line number Diff line number Diff line change @@ -2,4 +2,5 @@ node_modules
2
2
.cache
3
3
.next
4
4
storybook-static
5
- dist
5
+ dist
6
+ package-lock.json
You can’t perform that action at this time.
0 commit comments