Updated hooks to ensure folder exists before publishing