generated from tc39/template-for-proposals
-
Notifications
You must be signed in to change notification settings - Fork 2
36 lines (36 loc) · 1.22 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
32
33
34
35
36
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@v3
- uses: ljharb/actions/node/install@main
name: 'nvm install lts/* && npm install'
with:
node-version: lts/*
- run: npm run build
- name: Deploy
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: build
target-folder: pr/${{ github.event.number }}/
- id: get-preview-url
name: Get preview url
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
url=(gh api "repos/$GITHUB_REPOSITORY/pages" --jq '.html_url')
echo "preview-url=https://tc39.es/$(basename $GITHUB_REPOSITORY)/pr/${{ github.event.number }}" >> "$GITHUB_OUTPUT"
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 }}.