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

Commit

Permalink
Add GitHub Action website preview (#36)
Browse files Browse the repository at this point in the history
* Add GitHub Action website preview

* Update node version

* Add empty CI env

* Change to yarn

* Add PR comment

* Add PR comment
  • Loading branch information
machadovilaca authored Feb 15, 2021
1 parent d2fc035 commit 099b519
Showing 1 changed file with 33 additions and 0 deletions.
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 }}
- 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

0 comments on commit 099b519

Please sign in to comment.