Netlify continuous deployment already auto-deploys on every push to main + builds a deploy preview per PR. Add a build `ignore` so it only rebuilds when the demo actually changes (frontend/index.html, scripts/build_demo.py, netlify.toml), and document the behavior. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
19 lines
1.0 KiB
TOML
19 lines
1.0 KiB
TOML
# Netlify continuous deployment for the public live demo (the real frontend/index.html + a
|
|
# seeded mock API, no backend).
|
|
#
|
|
# One-time setup: connect this repo on Netlify (Add new site -> Import an existing project).
|
|
# After that Netlify AUTO-DEPLOYS on every push to the production branch (main) and builds a
|
|
# deploy preview for every pull request -- no extra config. The build runs the script below and
|
|
# serves _site/. (Cloudflare Pages equivalent: Build command "python3 scripts/build_demo.py
|
|
# _site", Output directory "_site".)
|
|
[build]
|
|
command = "python3 scripts/build_demo.py _site"
|
|
publish = "_site"
|
|
# Skip the build/deploy when nothing the demo depends on changed (saves build minutes):
|
|
# `git diff --quiet` exits 0 (-> Netlify cancels the build) when these files are unchanged.
|
|
# The first build (no cached ref) errors out of the diff and proceeds normally.
|
|
ignore = "git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF -- frontend/index.html scripts/build_demo.py netlify.toml"
|
|
|
|
[build.environment]
|
|
PYTHON_VERSION = "3.12"
|