This re-enable deploy-previews through Netlify. It will check if changes where made to the ./docs folder and build + deploy the preview if so. Otherwise, it will deploy a dummy preview. This also removes the netlify script to deploy in production whenever we push to master, as this is now handled by Travis.
23 lines
780 B
Bash
Executable file
23 lines
780 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
|
|
#
|
|
# Note: Check the following link for a list of available environment variables:
|
|
# https://www.netlify.com/docs/continuous-deployment/#build-environment-variables
|
|
if ! ./scripts/netlify/is-deploy-preview; then
|
|
echo "✘ This script should only be run on Netlify, for deploy previews";
|
|
exit 0
|
|
fi
|
|
|
|
if ! ./scripts/netlify/changes-in-docs-since-master; then
|
|
echo "✘ This PR does not have any changes done in ./docs."
|
|
mkdir -p ./docs/dist
|
|
echo "No deploy preview available as this PR does not change the documentation." > ./dist/index.html
|
|
exit 0
|
|
fi
|
|
|
|
|
|
# Full build if documentation changed
|
|
cd ./docs || exit
|
|
yarn install
|
|
yarn run build
|