File tree Expand file tree Collapse file tree 2 files changed +55
-47
lines changed
Expand file tree Collapse file tree 2 files changed +55
-47
lines changed Original file line number Diff line number Diff line change 44 push :
55 branches :
66 - master
7- pull_request :
8- types : [ opened, synchronize, reopened ]
9- branches :
10- - master
11-
12- concurrency : preview-${{ github.ref }}
137
148jobs :
159 build :
5044 deploy :
5145 name : Deploy to GitHub Pages
5246 needs : build
53- if : github.event_name == 'push'
5447
5548 # Grant GITHUB_TOKEN the permissions required to make a Pages deployment
5649 permissions :
6659 steps :
6760 - name : Deploy to GitHub Pages
6861 id : deployment
69- uses : actions/deploy-pages@v4
70-
71- deploy-preview :
72- name : " Deploy Preview for PR #${{github.event.pull_request.number}}"
73- if : github.event_name == 'pull_request' # Only run for pull requests
74- runs-on : ubuntu-latest
75- # Grant GITHUB_TOKEN the permissions required to make a Pages deployment
76- permissions :
77- pages : write # to deploy to Pages
78- pull-requests : write
79- contents : write
80- id-token : write
81-
82- env :
83- DOCASAURUS_BASE_URL : https://chargepi.cc/pr-preview-action/pr-${{github.event.pull_request.number}}
84-
85- steps :
86- - name : Checkout
87- uses : actions/checkout@v4
88-
89- - uses : actions/setup-node@v4
90- with :
91- node-version : latest
92- # cache: yarn
93-
94- - uses : pnpm/action-setup@v4
95- with :
96- version : 10.11.0
97-
98- - name : Install and Build
99- run : |
100- pnpm install
101- pnpm run build
102-
103- - name : Deploy preview
104- uses : rossjrw/pr-preview-action@v1
105- with :
106- source-dir : ./build/
107- action : ' auto'
108- pages-base-url : chargepi.cc
62+ uses : actions/deploy-pages@v4
Original file line number Diff line number Diff line change 1+ name : preview.yaml
2+ on :
3+ pull_request :
4+ types : [ opened, synchronize, reopened ]
5+ branches :
6+ - master
7+
8+ concurrency : preview-${{ github.ref }}
9+
10+ jobs :
11+ deploy-preview :
12+ name : " Deploy Preview for PR #${{github.event.pull_request.number}}"
13+ if : github.event_name == 'pull_request' # Only run for pull requests
14+ runs-on : ubuntu-latest
15+ # Grant GITHUB_TOKEN the permissions required to make a Pages deployment
16+ permissions :
17+ pages : write # to deploy to Pages
18+ pull-requests : write
19+ contents : write
20+ id-token : write
21+
22+ env :
23+ DOCASAURUS_BASE_URL : https://chargepi.cc/pr-preview-action/pr-${{github.event.pull_request.number}}
24+
25+ steps :
26+ - name : Checkout
27+ uses : actions/checkout@v4
28+
29+ - uses : actions/setup-node@v4
30+ with :
31+ node-version : latest
32+ # cache: yarn
33+
34+ - uses : pnpm/action-setup@v4
35+ with :
36+ version : 10.11.0
37+
38+ - name : Install and Build
39+ run : |
40+ pnpm install
41+ pnpm run build
42+
43+ - name : Deploy 🚀
44+ uses : JamesIves/github-pages-deploy-action@v4
45+ with :
46+ folder : build # The folder the action should deploy.
47+ target-folder : ${{ github.ref_name }}/build
48+
49+ - name : Deploy preview
50+ uses : rossjrw/pr-preview-action@v1
51+ with :
52+ source-dir : ${{ github.ref_name }}/build
53+ action : ' auto'
54+ pages-base-url : chargepi.cc
You can’t perform that action at this time.
0 commit comments