WHAT DOES POST DEPLOYMENT HOOK DO?
Post Deployment Hook is a lightweight and secure WordPress plugin that creates a webhook on your site.
Many services (like GitHub, Bitbucket, and Beanstalk) offer a feature called a commit webhook or a deployment webhook. After you push your code (or have their service deploy your code) they’ll optionally call a URL for you.
This plugin provides that URL on your WordPress site. It will listen for anything that tries to reach that URL and then execute any code you wish. (For example, if you just checked in some new CSS, you might want to automatically purge WP Super Cache so your visitors see the new styles).
* The “hook” functionality is also built directly into Git. If you have your own custom workflow you could certainly use this plugin as a post commit hook listener for your own CI workflow too.
If you use GitHub you can follow their Developer documentation to find everything you need to setup a webhook.
Check out the documentation for Bitbucket’s webhook configuration.
You can read the help article on setting up a post deployment hook from Beanstalk.