-
Notifications
You must be signed in to change notification settings - Fork 11
31 lines (31 loc) · 1.1 KB
/
pr.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
name: Publish PR to gh-pages/pr/
on:
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
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@v4
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 }}.