You are going to have to check how the system you are accessing is set up in terms of SSH - while your output shows that the deploy.sh script does get executed, it also indicates that you do not have all the env variables set that you expect - things like PATH are likely to be missing.
As I do not know your environment or the script you are running I can not be certain, but by the time you have started a session via SSH and then also created a new shell via sudo your env is not going to be what you expect.