Separate deploy task into lib