Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@
# Works for both regular PRs and forked PRs
ignore = "./netlify-ignore.sh"

[build.environment]
# Disable git submodules - they are not needed for the website build
GIT_SUBMODULES = "false"
16 changes: 6 additions & 10 deletions website/netlify-ignore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,26 @@
# Based on official Netlify documentation: https://docs.netlify.com/configure-builds/ignore-builds/
# Exit code: 0 = skip build, 1 = proceed with build

# Base branch name (adjust if your default branch is named differently)
# This script runs from the base directory (website/) but needs to check
# changes relative to the repository root
REPO_ROOT=$(git rev-parse --show-toplevel)
BASE_BRANCH="main"

# First, try using Netlify's environment variables (works for regular PRs)
if [ -n "$CACHED_COMMIT_REF" ] && [ -n "$COMMIT_REF" ]; then
if git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF -- 'website/' 2>/dev/null; then
# No changes in website/ directory - skip build
if git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF -- "$REPO_ROOT/website/" 2>/dev/null; then
exit 0
else
# Changes detected in website/ - proceed with build
exit 1
fi
fi

# For forked PRs or when env vars aren't available, fetch base branch and compare
# Fetch the latest commit on the base branch
git fetch origin $BASE_BRANCH:$BASE_BRANCH 2>/dev/null || true
git fetch origin $BASE_BRANCH 2>/dev/null || true

# Check for changes in the website/ directory using three-dot syntax (merge base comparison)
# The three-dot syntax (BASE_BRANCH...HEAD) compares the merge base to HEAD
if git diff --quiet origin/$BASE_BRANCH...HEAD -- 'website/' 2>/dev/null; then
# No changes detected in website/ directory - skip build
if git diff --quiet origin/$BASE_BRANCH...HEAD -- "$REPO_ROOT/website/" 2>/dev/null; then
exit 0
else
# Changes detected in website/ directory - proceed with build
exit 1
fi