After_success or deploy still run after script failed

Please reference this post where I post a workaround: