This process includes a downtime which can take a while depending on different factors like the number of modules, dependencies and of course the included database changes in a version.
While the static content can easily be deployed in non production environment and taken later into production (e.g. container, simlinks etc.), the database schema update is a challenge.

I have been wondering this myself because some people just can't handle any type of downtime for development reasons. It would be great if this answer receives some response. I can see in the devdocs that there are tools for the Magento Cloud Commerce platform where they achieve zero downtime while redeploying.
– gabtziJul 3 '19 at 12:23

zero-downtime = you can not run these commands you posted on live system. so with some little research you need to have pre-production system, you push updates from to live...
– MagenXNov 23 '19 at 13:22

1 Answer
1

Long story short, if there are database changes there will be downtime since you will need to do setup:upgrade and that will take the application down temporarily.

Currently, we have CI/CD setup on AWS, we build the application (static content deploy, di compile etc) and pack it as an EC2 AMI.
Once this is done, we deploy the new images into the cloud keeping the old ones running.
At this stage, we have the old version of the website running and new new version not receiving any traffic.
Then we enable maintenance mode, do setup upgrade, redirect traffic from old codebase to new codebase and disable maintenance.
Now you could say, do maintenance enable, setup upgrade and maintenance disable on the new codebase so the old codebase still processing requests, but the problem is that when you do setup:upgrade, since there is only one database working, both version of the codebase would go down.Doing this approach we achieve a few seconds downtime (the time setup:upgrade takes).