From e2ace1d8a897c41c6794e6906287856884d8c86f Mon Sep 17 00:00:00 2001 From: Peter Johanson Date: Mon, 18 Nov 2024 16:51:15 -0700 Subject: [PATCH] docs(ci): Netlify ignore command to check branch Add a separate ignore script that checks git changes but also only deploys main and version branches to allow us to deploy versioned docs. --- docs/netlify-ignore-command.sh | 9 +++++++++ docs/netlify.toml | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100755 docs/netlify-ignore-command.sh diff --git a/docs/netlify-ignore-command.sh b/docs/netlify-ignore-command.sh new file mode 100755 index 000000000000..0e8781558791 --- /dev/null +++ b/docs/netlify-ignore-command.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +# We deploy main and version branches only +if echo $HEAD | grep -E '^(main|v[[:digit:]]+\.([[:digit:]])+-branch)$' +then + git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF . ../app/boards/ +else + exit 1 +fi \ No newline at end of file diff --git a/docs/netlify.toml b/docs/netlify.toml index 874620061e5f..b0e79ed39c31 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-commands.sh" [[redirects]] from = "/community/discord/invite"