From 9ba5a1341416e5cbae1171d3eab396c20cf84949 Mon Sep 17 00:00:00 2001 From: joy Date: Wed, 2 Sep 2026 19:14:56 +0000 Subject: [PATCH] Add local preview files after the last build step --- scripts/previews/frontend_previews.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/previews/frontend_previews.py b/scripts/previews/frontend_previews.py index dac69a221..0047c9cdf 100644 --- a/scripts/previews/frontend_previews.py +++ b/scripts/previews/frontend_previews.py @@ -21,8 +21,8 @@ image = ( modal.Image.debian_slim() .pip_install("PyGithub~=2.6.1") - .add_local_dir(Path(__file__).resolve().parent / "nginx", NGINX_CONF_DIR) .add_local_file(_ASTRO_REDIRECTS, "/root/astro_redirects.py", copy=True) + .add_local_dir(Path(__file__).resolve().parent / "nginx", NGINX_CONF_DIR) ) with image.imports(): @@ -130,10 +130,11 @@ def deploy(self): ) if self.type == "docs": - image = image.add_local_file(NGINX_CONF_DIR / "docs.conf", remote_conf) inc = Path(tempfile.mkdtemp()) / "astro-refresh.inc" inc.write_text(_docs_nginx_refresh_inc(refresh_map_from_tarball(path))) - image = image.add_local_file(inc, "/etc/nginx/astro-refresh.inc", copy=True) + image = image.add_local_file( + inc, "/etc/nginx/astro-refresh.inc", copy=True + ).add_local_file(NGINX_CONF_DIR / "docs.conf", remote_conf) sb_app = modal.App.lookup(SANDBOX_APP_NAME, create_if_missing=True) self.expiration = datetime.now() + SANDBOX_TIMEOUT