18 lines
647 B
Bash
Executable file
18 lines
647 B
Bash
Executable file
#!/usr/bin/env sh
|
|
# This script is triggered on every new PR (see netlify.toml for details)
|
|
# It will create a live preview of the PR
|
|
set -e
|
|
|
|
# Environment variables exposed by Netlify:
|
|
# https://www.netlify.com/docs/continuous-deployment/#build-environment-variables
|
|
# $REPOSITORY_URL, $BRANCH, $PULL_REQUEST, $HEAD, $COMMIT_REF, $CONTEXT,
|
|
# $REVIEW_ID
|
|
|
|
# We build a very simple preview if no change were made to the docs
|
|
cd ./docs
|
|
if ! git diff --name-status master | grep 'docs/' 1>/dev/null; then
|
|
mkdir -p ./dist
|
|
echo "No deploy preview available as this PR does not change the documentation." > ./dist/index.html
|
|
else
|
|
yarn run build
|
|
fi
|