On murze.be an article is published that explains how to perform deployments minimal with downtime. The article uses envoy, a taskrunner of the Laravel framework, but the described mechanism can also be used without.
The steps basically boil down to:
- Place the code in a folder below the htdocs root
- Copy configuration and other files if necessary from the previous deployment to this folder
- Unlink the current document root
- Create a link from the new deployment folder to the document root
Read https://murze.be/2015/11/zero-downtime-deployments-with-envoy/