misc(v2): v1 backward compatibility for USE_SSH env var (#1880)

* misc(v2): address comments

* misc(v2): update CHANGELOG
This commit is contained in:
Yunus Rahbar 2019-10-27 14:36:45 -07:00 committed by Yangshun Tay
parent 421598eb65
commit 812a30be57
2 changed files with 5 additions and 3 deletions

View file

@ -7,6 +7,7 @@
- Convert sitemap plugin to TypeScript. - Convert sitemap plugin to TypeScript.
- Significantly reduce main bundle size and initial HTML payload on production build. Generated JS files from webpack is also shorter in name. - Significantly reduce main bundle size and initial HTML payload on production build. Generated JS files from webpack is also shorter in name.
- Refactor dark toggle into a hook. - Refactor dark toggle into a hook.
- Changed the way we read the `USE_SSH` env variable during deployment to be the same as in v1.
## 2.0.0-alpha.31 ## 2.0.0-alpha.31

View file

@ -67,9 +67,10 @@ export async function deploy(siteDir: string): Promise<void> {
process.env.GITHUB_HOST || siteConfig.githubHost || 'github.com'; process.env.GITHUB_HOST || siteConfig.githubHost || 'github.com';
const useSSH = process.env.USE_SSH; const useSSH = process.env.USE_SSH;
const remoteBranch = useSSH const remoteBranch =
? `git@${githubHost}:${organizationName}/${projectName}.git` useSSH && useSSH.toLowerCase() === 'true'
: `https://${gitUser}@${githubHost}/${organizationName}/${projectName}.git`; ? `git@${githubHost}:${organizationName}/${projectName}.git`
: `https://${gitUser}@${githubHost}/${organizationName}/${projectName}.git`;
// Check if this is a cross-repo publish // Check if this is a cross-repo publish
const currentRepoUrl = shell const currentRepoUrl = shell