Extract publish task logic from grunt-gh-pages