cmc/cleberg.net

My personal web garden & blog.

clone: git clone https://gitbay.org/cmc/cleberg.net.git

0b3783a396ad74a869639b74719c3a3769e4b6e5

unsigned

author: Christian Cleberg <hello@cleberg.net> · 2026-08-12T00:26:42Z

Keep the build cache out of the deploy

.orgo-cache.json lives in the output directory because it describes that
directory, and the first orgo deploy put it on the server. Excluding it from
rsync stops that, and stops --delete removing it locally between builds.

The copy the first deploy left behind is gone from the server.
 build.py | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/build.py b/build.py
index 3bfc8fb..0d90e2b 100755
--- a/build.py
+++ b/build.py
@@ -369,7 +369,17 @@ def deploy_to_server(build_dir, server):
     remote_path = f"{server}:/var/www/cleberg.net/"
     print(f"Deploying .build/ → {remote_path}")
     result = subprocess.run(
-        ["rsync", "-r", "--delete-before", f"{build_dir}/", remote_path],
+        # The build cache lives in the output directory because it describes it, but it
+        # is not part of the site. Excluding it also stops --delete removing it locally.
+        [
+            "rsync",
+            "-r",
+            "--delete-before",
+            "--exclude",
+            ".orgo-cache.json",
+            f"{build_dir}/",
+            remote_path,
+        ],
         capture_output=True,
         text=True,
         check=False,