How deployment works

Changes are first prepared by the developer and tested on staging. Deployment is the moment they are moved to the live website. For a simple website, this may mean uploading a few files. For an online shop or web application, it also includes database changes, clearing the cache and possibly restarting background jobs.

Manual or automatic

Manual deployment means someone copies files over FTP and hopes they have not forgotten anything. It works until one file gets missed or something is overwritten that should not have been.

Automatic deployment is based on Git. Once the changes are approved, the server pulls the new version itself, runs the necessary steps and switches the website over in one go. If something fails, the deployment stops and the previous version keeps running. Rolling back takes a single command.

Why it matters

Most website problems arise during a change. A good deployment process shortens downtime, reduces the risk of errors and lets you deploy smaller changes more often. Small changes are easier to review, and when something goes wrong it is immediately clear what caused it.

A real-world example

A booking system for a chain of hair salons gets updates several times a month. Deployment is automatic and takes about two minutes, during which the system runs as normal. Once, a new version contained a bug in sending confirmation text messages. The previous version was restored within five minutes and the fix arrived the same day.

Tips

  • Do not deploy on a Friday afternoon or just before a sale. If something breaks, there is nobody to deal with it.
  • Back up the database before deploying, especially for an online shop.
  • Check the essentials after deploying: the home page, basket, checkout and forms.
  • Know how to roll back. A plan for returning to the previous version matters more than the deployment itself.

For my web applications, deployment is always automatic. After deployment, website management takes care of updates and backups.