Microsoft.SharePoint.Publishing is the assembly that we need to use to get pages created and published. A sample is provided below:
using (SPSite site = new SPSite("http://moss")) { using (SPWeb web = site.OpenWeb()) { PublishingSite pSite = new PublishingSite(site); SPContentType ctype = pSite.ContentTypes["Welcome Page"]; PageLayoutCollection pageLayouts = pSite.GetPageLayouts(ctype, true); PageLayout pageLayout = pageLayouts["/_catalogs/masterpage/welcomesplash.aspx"]; PublishingWeb pWeb = PublishingWeb.GetPublishingWeb(web); PublishingPageCollection pPages = pWeb.GetPublishingPages(); PublishingPage pPage = pPages.Add("Programmatic_Test.aspx", pageLayout); SPListItem newpage = pPage.ListItem; newpage["Title"] = "Page added programmatically"; newpage.Update(); newpage.File.CheckIn("all looks good"); newpage.File.Publish("all looks good"); } }