From 9d0c31f6739793e1dd12c9e590314c5fe69c7403 Mon Sep 17 00:00:00 2001 From: SkateSpots Date: Sun, 27 Sep 2026 14:42:57 +0700 Subject: [PATCH] chore(deploy): skip production deploys for non-site commits MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Netlify bills 15 credits per production deploy, and this cycle already spent ~315 on 21 deploys. auto-deploy.sh now skips when the change between the last deployed SHA and origin/main touches only non-site files (AGENTS.md/*.md, scripts/, cvm-server/, skills/) — it records the SHA without deploying, so doc commits cost nothing. --- scripts/auto-deploy.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/scripts/auto-deploy.sh b/scripts/auto-deploy.sh index 6a6052e..670aa88 100755 --- a/scripts/auto-deploy.sh +++ b/scripts/auto-deploy.sh @@ -55,6 +55,19 @@ if [ -n "$(git status --porcelain --untracked-files=no)" ]; then exit 0 fi +# 2b. Skip when the change cannot affect the deployed site. Netlify bills 15 +# credits per production deploy, so don't spend them on docs-only commits +# (AGENTS.md, NIP.md, scripts/, the standalone CVM server, etc.). +if [ -n "$LAST_SHA" ] && git cat-file -e "${LAST_SHA}^{commit}" 2>/dev/null; then + changed="$(git diff --name-only "$LAST_SHA" "$REMOTE_SHA" || true)" + site_affecting="$(printf '%s\n' "$changed" | grep -vE '^([^/]*\.md|scripts/|cvm-server/|skills/|\.agents/)' || true)" + if [ -n "$changed" ] && [ -z "$site_affecting" ]; then + log "origin/main moved to ${REMOTE_SHA:0:9} but only non-site files changed — skipping deploy (no credits spent)" + echo "$REMOTE_SHA" > "$SHA_FILE" + exit 0 + fi +fi + # 3. Move the repo to the published commit (fast-forward only). if [ "$(git rev-parse HEAD)" != "$REMOTE_SHA" ]; then if git merge --ff-only --quiet origin/main; then