Skip to content

Commit d94c543

Browse files
authored
Merge pull request #149 from ethdebug/previews
Use Github Pages for PR previews
2 parents 8f70b10 + b1c3fe2 commit d94c543

File tree

2 files changed

+46
-7
lines changed

2 files changed

+46
-7
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

.github/workflows/gh-pages.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,16 @@ jobs:
2323
working-directory: ./packages/web
2424

2525
- name: Deploy to GitHub Pages
26-
uses: peaceiris/actions-gh-pages@v3
26+
uses: JamesIves/github-pages-deploy-action@v4
2727
with:
28-
github_token: ${{ secrets.GITHUB_TOKEN }}
29-
30-
publish_dir: ./packages/web/build
31-
28+
token: ${{ secrets.GITHUB_TOKEN }}
29+
folder: ./packages/web/build
30+
branch: gh-pages
3231
# default deployer
33-
user_name: 'github-actions[bot]'
34-
user_email: 'github-actions[bot]@users.noreply.github.com'
32+
git-config-name: 'github-actions[bot]'
33+
git-config-email: 'github-actions[bot]@users.noreply.github.com'
34+
# don't break preview deployments
35+
clean-exclude: pr-preview
36+
force: false
37+
3538

0 commit comments

Comments
 (0)