For proper release automation, I would suggest the following good practices
1) Validate the quality of the code as soon as possible. For this, you can use linting, or tools like Sonar.
2) Build and deploy in development or continuous integration environment at least…