Skip to content

Add PR previews #33

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

Merged
merged 3 commits into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ jobs:
uses: peaceiris/actions-gh-pages@v3
with:
publish_dir: ./build
keep_files: true
github_token: ${{ secrets.GITHUB_TOKEN }}
33 changes: 33 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Publish PR to gh-pages/pr/
on:
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
permissions:
pull-requests: write
if: ${{ github.event.number }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- run: npm install
- run: npm run build
- name: Publish HTML to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
publish_dir: ./build
destination_dir: pr/${{ github.event.number }}/
keep_files: true
github_token: ${{ secrets.GITHUB_TOKEN }}
- id: get-preview-url
name: Get preview url
run: echo "::set-output name=preview-url::https://tc39.es/$(basename $GITHUB_REPOSITORY)/pr/${{ github.event.number }}"
shell: bash
- name: Post Preview Comment
uses: phulsechinmay/[email protected]
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COMMENT_IDENTIFIER: tc39_pr_preview_comment
message: |
A preview of this PR can be found at ${{ steps.get-preview-url.outputs.preview-url }}.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
node_modules
build
node_modules
build
Loading