You can pass optional properties to the MSBuild script to call MSDeploy (Assuming you have it setup on both the client/server).
/p:DeployOnBuild=True – This will let us deploy after build
/p:DeployTarget=MsDeployPublish – This set how we will deploy, using MSDeploy
/p:MSDeployServiceURL=http:///MsDeployAgentService
/p:DeployIISAppPath="Default Web Site" – The path where the app will be deployed
/p:CreatePackageOnPublish=True – Create a package to deploy the App
/p:MsDeployPublishMethod=RemoteAgent – Server where the MSDeploy is installed. The possible values for this are:
RemoteAgent – When the MSDeploy is deployed at another machine
InProc – Deploy to the Local IIS
/p:AllowUntrustedCertificated=True – Connect to the MSDeployServiceURL without trying to use certificate.
To use a certificate you should use another URL on the MSDeployServiceURL.
/p:UserName=username – The username of a user with permission to Deploy the application
/p:Password=password – a VALID password for that user :)
Taken from Allmatech ALM Team