Look in the manual for "Publish". All info you need is on that page.
You can define folders for your models with 3 methods. The preferred method is setting the paths in WED. Second best is a "PATH" statement in your WDL file. The third method is add_folder(), but that's a function call and more overhead. "#define PRAGMA_PATH" is a compiler directive for special purposes - it's for the experts only and not for publishing projects.