Factor out common components in update-gh-pages