Moved the directory creation to later in the publish process so that we don't end up with an empty directory if a publish fails early on.