1
0
Fork 0
docsearch/scripts/netlify/changes-in-docs-since-master
Pixelastic df7c60ac17 docs(deploy-preview): Re-enable deploy previews for the doc
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.
2018-12-14 12:05:41 +01:00

15 lines
366 B
Bash
Executable file

#!/usr/bin/env bash
# Compare current branch with master to see if there are changes in the docs/
# folder
set -x
# Remote urls are not always set on Netlify
git remote set-url origin https://github.com/algolia/docsearch.git
git fetch
CHANGES_IN_DOCS="$(git diff --name-only origin/master | grep '^docs/')"
if [ "$CHANGES_IN_DOCS" = "" ]; then
exit 1
fi
exit 0