Ideally, you would like the production to be an exact copy of the product. Thus, what you see in the production can be pretty sure what you will see in the production process. Automatically clicking on the stage when you commit will not do this, since any errors that you enter with the commit are instantly sent to the stage.
What you may wish for is to set up a different environment and call it testing. This will be your automatic click on commit. Use this environment to run QA, and from there you can pack the code and press push to perform the final test. If everything goes well at the stage of setting, then click on the package for production.
As for the problem with the domain name, I would recommend not hard-coding them if you can handle it. Or at least use subdomains for different environments to make it easier to determine which software environment you are in.
In order for your database to be updated in different environments, you may want to periodically dump from production and update the experience, testing and dev environment with this dump. Once a day you need to work. Thus, you develop and test what your users see in the production process.
Darrell brogdon
source share