From a549aee2f191b1c73f25de6d494481f09339fcc2 Mon Sep 17 00:00:00 2001 From: ops Date: Tue, 2 Jun 2026 00:06:23 +0000 Subject: [PATCH] static: remove old container last (zero-downtime cutover) --- action.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/action.yml b/action.yml index e77ee55..c45349c 100644 --- a/action.yml +++ b/action.yml @@ -137,7 +137,6 @@ runs: case "$DT" in static) - docker rm -f "$SLUG" >/dev/null 2>&1 || true # in case it was previously a container deploy echo "::group::build (bun)" BH="build-${SLUG}-${SHA}" docker rm -f "$BH" >/dev/null 2>&1 || true @@ -163,6 +162,10 @@ runs: echo "::endgroup::" write_fragment "$(printf '%s {\n\troot * /srv/sites/%s\n\tfile_server\n\ttry_files {path} /index.html\n}\n' "$SITE_ADDR" "$DOMAIN")" + # Remove any prior container LAST — zero-downtime: a pre-existing + # container kept serving the domain (via its old fragment) all through + # the build above, until the file_server fragment took over just now. + docker rm -f "$SLUG" >/dev/null 2>&1 && echo " removed old container (switched to static)" || true ;; docker|docker-db)