To implement automatic publishing from staging to production, you can use continuous delivery (CD) and a CI/CD pipeline. CD ensures that code is always ready to deploy, by automatically building, testing, and deploying code to production-like environments. Adding CD to create a full CI/CD pipeline helps you detect code defects as soon as possible. It also ensures that you can release properly tested updates in a short time.
You can set up a pipeline that automatically deploys each application to your test, staging, and production environments. Have systems in place to detect any problems during rollout, and have an automated way to roll forward fixes or roll back changes. This pipeline should be triggered by a code commit or check-in, and should run at least once per day.
To facilitate CD, you can consider adopting a trunk-based development model, where developers commit to a single branch (the trunk) and commits never break a build. This model facilitates CI, because you do all feature work in the trunk, and you resolve any merge conflicts when each commit happens.
You can also use feature toggles to control when you turn on features for end users. This helps you control exposure to changes and make sure that you're in control of when updates become visible to your end users.
References: