Break deploy into scripts that only run when pushing into master, and the deploy hook to run on successful builds. I think.