File tree Expand file tree Collapse file tree 2 files changed +43
-13
lines changed
Expand file tree Collapse file tree 2 files changed +43
-13
lines changed Original file line number Diff line number Diff line change 1010 build-and-deploy :
1111 runs-on : ubuntu-latest
1212 permissions :
13- contents : read
14- pages : write
15- id-token : write
13+ contents : write
1614
1715 steps :
1816 - name : Checkout
@@ -39,14 +37,10 @@ jobs:
3937 - name : Build
4038 run : npm run build
4139
42- - name : Setup Pages
43- uses : actions/configure-pages@v4
44-
45- - name : Upload artifact
46- uses : actions/upload-pages-artifact@v3
47- with :
48- path : ' ./dist'
49-
5040 - name : Deploy to GitHub Pages
51- id : deployment
52- uses : actions/deploy-pages@v4
41+ uses : JamesIves/github-pages-deploy-action@v4
42+ with :
43+ folder : ./dist
44+ branch : gh-pages
45+ clean-exclude : pr-preview
46+ force : false
Original file line number Diff line number Diff line change 1+ name : Deploy PR Preview
2+
3+ on :
4+ pull_request :
5+ types : [opened, reopened, synchronize, closed]
6+
7+ permissions :
8+ contents : write
9+ pull-requests : write
10+
11+ jobs :
12+ deploy-preview :
13+ runs-on : ubuntu-latest
14+ steps :
15+ - name : Checkout
16+ uses : actions/checkout@v4
17+
18+ - name : Setup Node.js
19+ uses : actions/setup-node@v4
20+ with :
21+ node-version : ' 20'
22+ cache : ' npm'
23+
24+ - name : Install and Build
25+ if : github.event.action != 'closed'
26+ run : |
27+ npm install
28+ npm run build
29+
30+ - name : Deploy preview
31+ uses : rossjrw/pr-preview-action@v1
32+ with :
33+ source-dir : ./dist/
34+ pages-base-url : log.javazero.top
35+ preview-branch : gh-pages
36+
You can’t perform that action at this time.
0 commit comments