Currently I have my git set up for AngularJS Projects. I do testing locally and if the tests pass I commit the code to Git repo. What I want to do is set up the UI project with CI and CD such that even after testing locally when I commit the code to Git repo it should trigger tests and then build (for Angular2 or minify for example for AngularJS) the project ready to be used. If the tests fail it should reject the push/changes. It should then push the passed code to the appropriate deployment folder automatically.
Can Grunt/Gulp do this or I need some other CI/CD apps/tools for this. If so can someone explain how to set this up?