diff --git a/lib/publish-gh-pages.js b/lib/publish-gh-pages.js index e9555965a6787..95b2639419acd 100755 --- a/lib/publish-gh-pages.js +++ b/lib/publish-gh-pages.js @@ -35,9 +35,10 @@ const USE_SSH = process.env.USE_SSH; // github.io indicates organization repos that deploy via master. All others use gh-pages. const DEPLOYMENT_BRANCH = PROJECT_NAME.indexOf('.github.io') !== -1 ? 'master' : 'gh-pages'; -// for github enterprise support, should be possible to specify a different host than github.com +const GITHUB_DOMAIN = 'github.com'; +// For GitHub enterprise, allow specifying a different host. const GITHUB_HOST = - process.env.GITHUB_HOST || siteConfig.githubHost || 'github.com'; + process.env.GITHUB_HOST || siteConfig.githubHost || GITHUB_DOMAIN; if (!ORGANIZATION_NAME) { shell.echo( @@ -154,7 +155,7 @@ fs.copy( } else if (commitResults.code === 0) { // The commit might return a non-zero value when site is up to date. const websiteURL = - GITHUB_HOST === 'github.com' + GITHUB_HOST === GITHUB_DOMAIN ? `https://${ORGANIZATION_NAME}.github.io/${PROJECT_NAME}` // gh-pages hosted repo : `https://${GITHUB_HOST}/pages/${ORGANIZATION_NAME}/${PROJECT_NAME}`; // GitHub enterprise hosting. shell.echo(`Website is live at: ${websiteURL}`);