WCF - How to publish from the command line using MSBuild
You can do this with msbuild, by specifying the build properties DeployOnBuild and PublishProfile. Don't forget to set the build configuration to Release, so that you aren't deploying a Debug build.