Fixed: make sure to deploy only if the build was successful