switched ssh generation to post-build hook
refactored deploy function a bit