DEPLOYMENT

Static Deployment Best Practices: Make Every Release Reversible

Set up a static release checklist for source revisions, validation, staged publication, rollback and communication after a site update.

TL;DR: Pin the source, validate the generated files, publish only a ready release and keep a known-good artifact. Check the public address and one important user journey. Rolling back restores files; separately plan changes to external APIs and data.

Introduction

Static deployment best practices matter when the person with the power to publish is not the person who wrote the original code. A predictable release gives both people the same evidence. They should be able to identify the exact source, see how it was built and understand what the site will serve after the change.

Build the routine while the site is small. A checklist with a few precise questions, applied consistently, is more useful than a long document that nobody reads. The goal is to reduce the number of facts a teammate has to remember during a failed deployment.

What is a reversible deployment?

A reversible deployment selects a previously prepared artifact so that the public site can return to a recorded state without reconstructing it from a changing branch. It requires a record of the output and a way to publish or restore it. A commit is useful context, but rebuilding it can still pick up different dependencies, build inputs or compiler settings.

Static deployment separates source, output and routing. The build's success is evidence about the output. DNS and TLS readiness are evidence about the address. Link the two through an explicit release so you can later explain what was actually live.

Why keeping evidence matters

  • Pinned source: A commit hash or traceable ZIP makes it possible to compare versions later.
  • Known output: Retained output means recovery does not depend on today's npm registry or a modified repository branch.
  • Verified address: A success screen is less useful than a request to the hostname the audience actually uses.
  • Named owner: Assign someone to inspect the result and someone to decide when rollback is appropriate.

How to design the release steps

Pin the inputs and validate the build

Put the lockfile, named build script and intended output path under review. Avoid including private credentials in build scripts or generated files. When a static page uses external services, document the public endpoint configuration and check which environment the new release targets. Verify that output includes index.html and the files requested by an important page.

Divide build approval from publication

Treat a completed build as a candidate. For a routine change, automate if you can preserve checks such as passing tests and a trusted branch. For a high-impact update, let someone verify the important visitor journey first. In KairoBase, a release can remain ready while publication checks fail without replacing the current live site.

Record recovery and communicate clearly

Note the previous version, the new version and a simple threshold for restoring: for example, “checkout links lead to the wrong site on public pages.” Roll back the static output when appropriate, then verify the affected URL. If the release also changed an API contract or data schema, check their compatibility with the restored front end; static rollback cannot undo those external changes.

StageRecordEvidence before proceeding
SourceCommit or immutable ZIPIntended changes and settings reviewed
BuildRelease ID and output directoryStatic assets present, important routes work
PublishHostname and selected releaseValid HTTPS and meaningful public response
RecoverKnown-good artifactRestored files and dependent integrations operate

Practical steps

  1. Use one branch and one documented build configuration for normal releases.
  2. Before publication, test a direct URL, the primary action and a missing asset or route.
  3. Publish, then verify the public address in a clean browser and record what went live.
  4. Practice restoring a retained version on a test site so the first attempt is not during an outage.

Common mistakes

  • Marking a release successful based on CI alone even though the public URL uses a different origin.
  • Deleting the only known-good artifact to save space before checking whether it has been backed up.
  • Changing the front end and backend together with no compatibility window.

Frequently asked questions

When should I use automatic publishing? When sources are trusted, meaningful checks run before release, and someone knows how to restore the last good artifact.

How many versions should I retain? Enough to meet your recovery needs within your storage budget. Keep a separate backup of releases that matter beyond ordinary retention.

Should I roll back every broken link? Consider impact. A minor typo may be faster to fix forward, while a broken primary task may warrant restoring the previous release.

Can I roll back a deleted site through deployments? Retention and routing depend on the deletion policy. Unpublish first if you expect to restore a site without asking an operator.

What information should a release note contain? State the intended change, the public URL, the release reference and enough context to verify or reverse it.

Conclusion

A release process earns its keep when you can explain what changed and restore a working version quickly. Read KairoBase release history and recovery and the GitHub deployment guide before automating publication. For gradual rollout principles, see Google’s SRE guidance on canarying releases.

Related reading