Skip to content
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
63 changes: 63 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Pull Requests

on:
pull_request:
branches: [ mainline ]

workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-

# Runs a single command using the runners shell
- name: Setup Node.js environment
uses: actions/setup-node@v2
with:
node-version: '14'
- name: Install dependencies 📦
run: yarn install --frozen-lockfile
- name: Build 🛠
run: yarn build
- name: Deploy preview🔎
run: yarn deploy:preview | tee output.log
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
- name: Extract draft url 📝
id: draft-url
run: |
URL=$(cat output.log | fgrep "Website Draft URL")
echo $URL
echo ::set-output name=url::$(echo $URL)
shell: bash
- uses: mshick/add-pr-comment@v1
with:
message: |
**Latest preview link**

Please check out the preview link to ensure that the doc site renders correctly
🌏 ${{ steps.draft-url.outputs.url }}!
repo-token: ${{ secrets.GITHUB_TOKEN }}
repo-token-user-login: 'github-actions[bot]'
allow-repeats: false # This is the default

1 change: 1 addition & 0 deletions .github/workflows/template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Check out the draft URL: