My requirement is that whenever developers are pushing to github, then before the push a CI build should trigger on Jenkins server. If that build fails, then push to github
This isn't generally the workflow possible with GitHub.
You would rather use a "guarded commits" model with 2 GitHub repo:
that's what the requirement is for my project, which can't be changed
In that case, It is best to follow Building a CI server which will:
That means the devs should push only to a "dev" branch, monitored by your server, and your CI engine would push those commits to the master branch if the compilation passes.