Detect failures and stop the deploy

Fixes #46.

It worked for the failing and a successful builds that I tried. My only worry is that some minor step might fail during a build and make the whole thing fail, but time will tell.