You can place rake tasks that you want to run on every deploy in the post deploy script.
This can be found in the Hatchbox UI by selecting "Apps" from the top menu, then select your app and you will see the Dashboard screen. Click on the "Edit" button to the far right which will take you to the page with the post deploy script input option.
The post deploy script only runs once, and is safer for things like rake tasks which need to run once every deploy.