Skip to content

Commit b1c3fe2

Browse files
committed
Add workflow for deploying PR previews
1 parent de4cc14 commit b1c3fe2

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Deploy PR preview
2+
on:
3+
pull_request:
4+
types:
5+
- opened
6+
- reopened
7+
- synchronize
8+
- closed
9+
10+
jobs:
11+
deploy-preview:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v3
15+
16+
- uses: actions/setup-node@v3
17+
with:
18+
node-version: 20
19+
cache: yarn
20+
cache-dependency-path: yarn.lock
21+
22+
- name: Install dependencies
23+
run: yarn install --frozen-lockfile
24+
25+
- name: Build website
26+
run: BASE_URL='/format/pr-preview/pr-${{ github.event.number }}/' yarn build
27+
working-directory: ./packages/web
28+
29+
- name: Deploy to GitHub Pages
30+
uses: rossjrw/pr-preview-action@v1
31+
with:
32+
token: ${{ secrets.GITHUB_TOKEN }}
33+
source-dir: ./packages/web/build
34+
preview-branch: gh-pages
35+
umbrella-dir: pr-preview
36+
action: auto

0 commit comments

Comments
 (0)