I have been having a look at using MSBuild for deployment, including things like setting up IIS webs and application pools. Guy Smith-Ferrier has a nice PDF introducing the basic concepts like properties, items, targets etc. There is also the MSBuild Reference on MSDN to help get you started.
That’s fine for building projects using the standard MSBuild tasks, but how about configuring IIS during deployment? It should not be too awful implementing your own custom task, but there already seems to be a decent number of task libraries floating around, such as MSBuild Community Tasks Project and SDC Tasks.
Using these it should be fairly straight forward to do things like pulling code from source control, building, running unit tests, then deploying to a server along with the relevant configuration.
UPDATE: Microsoft’s Web Deployment Projects also provide some additional MSBuild tasks relating to deploying web applications.