Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build page preview on all PRs #611

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions .github/workflows/gh-page-preview.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
name: PR Preview

on:
pull_request:
pull_request_target:
types: [opened, synchronize, reopened]
paths:
- 'website/**'

jobs:
build-and-deploy:
Expand All @@ -14,7 +12,7 @@ jobs:
- name: Checkout PR Branch
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
fetch-depth: 1

- name: Set up Python
uses: actions/setup-python@v5
Expand Down Expand Up @@ -42,11 +40,10 @@ jobs:
working-directory: ./website

- name: Deploy to Publication Branch
uses: peaceiris/actions-gh-pages@v3
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./website/.output/public
publish_branch: gh-pages
destination_dir: __preview/pr-${{ github.event.pull_request.number }}

- name: Create or Update PR Comment with Preview Link
Expand All @@ -72,4 +69,4 @@ jobs:
run: |
git rm -rf __preview/pr-${{ github.event.pull_request.number }}
git commit -m "Remove preview for PR #${{ github.event.pull_request.number }}"
git push origin gh-pages
git push origin gh-pages