build and deploy template