Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Add GitHub Action website preview #36

Merged
merged 6 commits into from
Feb 15, 2021
Merged
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
33 changes: 33 additions & 0 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Preview on merge request

on:
pull_request:
types: [opened, synchronize, reopened]

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 15.7.0
- name: Build website
run: yarn && CI='' yarn build
- name: Upload to netlify
uses: netlify/actions/cli@master
id: deploy-netlify
with:
args: deploy
env:
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See this to comment on PR the deploy preview url

- name: Netlify Preview URL
uses: unsplash/comment-on-pr@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OUTPUT: "This pull request is being automatically deployed to Netlify.\n\n🔍 Inspect: ${{ steps.deploy-netlify.outputs.NETLIFY_LOGS_URL }}\n✅ Preview: ${{ steps.deploy-netlify.outputs.NETLIFY_URL }}"
with:
msg: ${{ env.OUTPUT }}
check_for_duplicate_msg: false