1. A computer-implemented method to optimize resource usage and automate a deployment pipeline that generates an application program, the computer-implemented method comprising: generating a deployment pipeline model comprising a plurality of deployment stages by: for each of the deployment stages, retrieving a development stage policy that describes resources to execute a respective one of the deployment stages; for each task of the respective one of the deployment stages, retrieving a task policy that describes resources to execute the task; generating a deployment model for the respective one of the deployment stages and the task based on the development stage policy and the task policy; and forming the deployment pipeline model by combining the deployment model generated for each of the deployment stages and the task; optimizing a cost of the deployment pipeline model by: generating a plurality of model combinations of virtual machines for potential execution of the deployment pipeline model; for each of the model combinations of virtual machines: identifying existing ones of the virtual machines that are able to be utilized and new virtual machines that are required to be created for the deployment pipeline model; and determining a cost for a respective one of the model combinations based at least in part on the existing ones of the virtual machines that are able to be utilized and the new virtual machines that are required to be created for the deployment pipeline model; and executing the deployment pipeline model on one of the model combinations of virtual machines having a lowest cost in a cloud computing infrastructure to generate and deploy the application program.