Refactored publish-docs task.