Skip to content

Switch from build hooks to Netlify ignore builds#4

Merged
jonathanmoore merged 1 commit into
mainfrom
switch-to-netlify-ignore
Apr 9, 2026
Merged

Switch from build hooks to Netlify ignore builds#4
jonathanmoore merged 1 commit into
mainfrom
switch-to-netlify-ignore

Conversation

@jonathanmoore
Copy link
Copy Markdown
Owner

Summary

Simplifies docs deployment by using Netlify's native ignore builds feature instead of GitHub Actions build hooks.

Why This Change?

The build hook approach required:

  • GitHub Actions workflow with secrets
  • Stopping auto-publishing in Netlify
  • Managing build hook URLs

The ignore builds approach is simpler:

  • Native Netlify feature
  • Works with standard git auto-publishing
  • Better UI visibility ("Build skipped" messages)
  • One less workflow to maintain

Changes

Added

  • netlify.toml - Configures ignore builds using git diff

Removed

  • .github/workflows/docs-deploy.yml - No longer needed

How It Works

[build]
  ignore = "git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF -- docs/ package.json pnpm-lock.yaml"
  • git diff --quiet returns exit 0 if no changes → Netlify skips build
  • Returns exit 1 if changes detected → Netlify builds

Netlify Configuration Required

After merging, in Netlify dashboard:

  1. Activate builds (if not already active)
  2. Keep git connected (standard setup)
  3. Keep auto-publishing enabled
  4. Delete the build hook (no longer needed)

That's it! Netlify will automatically use the ignore command from netlify.toml.

Testing

After merge:

  • Push a theme-only change → Netlify should skip build
  • Push a docs change → Netlify should build
  • Check Netlify UI for "Build skipped" vs "Building" messages

Co-Authored-By: Claude Sonnet 4.5 noreply@anthropic.com

Simplifies docs deployment by using Netlify's native ignore builds feature
instead of GitHub Actions build hooks.

Changes:
- Add netlify.toml with ignore command for selective builds
- Remove docs-deploy.yml workflow (no longer needed)
- Netlify will now auto-build from git when docs change
- Uses git diff to detect changes in docs/, package.json, pnpm-lock.yaml

Benefits:
- Simpler setup (no GitHub Actions workflow or secrets needed)
- Native Netlify feature with better UI visibility
- Clearer "Build skipped" messages in Netlify dashboard

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 9, 2026

Deploy Preview for kona-theme canceled.

Name Link
🔨 Latest commit 76588fd
🔍 Latest deploy log https://app.netlify.com/projects/kona-theme/deploys/69d808a1eb60bc00081e0356

@jonathanmoore jonathanmoore merged commit b00c5d2 into main Apr 9, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant