Skip to content

Commit 756f059

Browse files
committed
Add PR preview deployment workflow
1 parent 3f2873d commit 756f059

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

.github/workflows/pr-preview.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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+

0 commit comments

Comments
 (0)