Skip to content

Commit cfda2ac

Browse files
authored
Add PR preview workflow configuration
1 parent 0daad33 commit cfda2ac

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

.github/workflows/pr-preview.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: PR Preview
2+
3+
on:
4+
pull_request:
5+
branches: [ main ]
6+
7+
jobs:
8+
build-and-deploy:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v4
14+
with:
15+
fetch-depth: 0
16+
17+
- name: Setup Node
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version: 18
21+
22+
- name: Install dependencies
23+
run: npm ci
24+
25+
- name: Build site
26+
run: npm run build
27+
28+
- name: Deploy PR preview
29+
uses: peaceiris/actions-gh-pages@v3
30+
with:
31+
github_token: ${{ secrets.GITHUB_TOKEN }}
32+
publish_branch: gh-pages
33+
publish_dir: ./build
34+
destination_dir: previews/pr-${{ github.event.pull_request.number }}

0 commit comments

Comments
 (0)