Skip to content

Commit 7f3fd9a

Browse files
committed
add pr preview workflow
1 parent 339096d commit 7f3fd9a

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

.github/workflows/pr-preview.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Deploy PR Preview
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- reopened
8+
- synchronize
9+
- closed
10+
workflow_dispatch:
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: Setup Node.js
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: "20"
25+
26+
- name: Setup pnpm
27+
uses: pnpm/action-setup@v4
28+
with:
29+
version: latest
30+
31+
- name: Install dependencies
32+
if: github.event.action != 'closed'
33+
run: pnpm install
34+
35+
- name: Build
36+
if: github.event.action != 'closed'
37+
run: pnpm build
38+
39+
- name: Deploy preview
40+
uses: rossjrw/pr-preview-action@v1
41+
with:
42+
source-dir: ./dist
43+
preview-branch: gh-pages
44+
umbrella-dir: pr-preview
45+
action: auto

0 commit comments

Comments
 (0)