Stage 2 #6
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }}. |