The best way to publish an application is not by Git, but by an CI (Continuous Integration) process. In fact, CI, will solve only build (build), run tests, package, etc... and an automatic deployment process will do the installation in the environment for you.
It may seem more complex, but the simple action of pushing code to a server causes some problems to arise:
- Reference objects in the code repository: compiled languages usually have libraries (libs) as reference, already in nodejs, for example, and these binaries should not be in the code repository, the compilation process is responsible for accessing it and making them available for compilation, and after, package together with the generated torque.
- Secrets or environment settings: Database passwords and other keys, or even service Urls are different in the production environment compared to the development environment. An automated deployment process will make this switch.
Anyway, the benefits are diverse, so introducing an IC brings many gains to the process. There are several options: