mirror of
https://github.com/zmkfirmware/zmk.git
synced 2026-03-19 20:45:18 -05:00
docs(ci): Netlify ignore command to check branch (#2659)
Add a separate ignore script that checks git changes but also only deploys main and version branches to allow us to deploy versioned docs. Co-authored-by: Cem Aksoylar <caksoylar@users.noreply.github.com>
This commit is contained in:
11
docs/netlify-ignore-command.sh
Executable file
11
docs/netlify-ignore-command.sh
Executable file
@@ -0,0 +1,11 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# We deploy main, version branches and deploy previews only
|
||||||
|
if echo $HEAD | grep -E '^(main|v[[:digit:]]+\.([[:digit:]])+-branch)$' || echo $CONTEXT | grep '^deploy-preview$'
|
||||||
|
then
|
||||||
|
echo "Head '$HEAD' matches a deployed branch, or context is deploy preview, checking for git changes."
|
||||||
|
git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF . ../app/boards/
|
||||||
|
else
|
||||||
|
echo "Head '$HEAD' does not match a deployed branch and is not a deploy preview"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
[build]
|
[build]
|
||||||
ignore = "git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF . ../app/boards/"
|
ignore = "bash ./netlify-ignore-command.sh"
|
||||||
|
|
||||||
[[redirects]]
|
[[redirects]]
|
||||||
from = "/community/discord/invite"
|
from = "/community/discord/invite"
|
||||||
|
|||||||
Reference in New Issue
Block a user