I am trying to configure webhooks in github so that it will deploy every time I do a new push, I have added web hooks in github and given the address of jenkins which is h
If you are talking about github.com, then yes, localhost would not work.
As mentioned in "GitHub webhook configuration "
the Jenkins instance must be able to connect to GitHub and vice versa.
You can check that with the "Test hook" button from the GitHub UI and see if Jenkins receive a payload.
Make sure you have the JENKINS GitHub Plugin properly installed and configured.