Build: optimized the deploy logic