diff --git a/docs/netlify-ignore-command.sh b/docs/netlify-ignore-command.sh new file mode 100755 index 000000000000..0b8bc1a056bb --- /dev/null +++ b/docs/netlify-ignore-command.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +# We deploy main and version branches only +if echo $HEAD | grep -E '^(main|v[[:digit:]]+\.([[:digit:]])+-branch)$' +then + echo "Head '$HEAD' matches a deployed branch, checking for git changes." + git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF . ../app/boards/ +else + echo "Head '$HEAD' does not match a deployed branch, ignoring" + exit 0 +fi \ No newline at end of file diff --git a/docs/netlify.toml b/docs/netlify.toml index 874620061e5f..b656b9e8a0fa 100644 --- a/docs/netlify.toml +++ b/docs/netlify.toml @@ -1,5 +1,5 @@ [build] - ignore = "git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF . ../app/boards/" + ignore = "bash ./netlify-ignore-command.sh" [[redirects]] from = "/community/discord/invite"