mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-29 08:57:03 +02:00
Add ssh option to publish script
This commit is contained in:
parent
9d3afe2412
commit
37174fd305
2 changed files with 10 additions and 2 deletions
|
@ -15,4 +15,4 @@ deployment:
|
|||
- git config --global user.email "facebook-github-bot@users.noreply.github.com"
|
||||
- git config --global user.name "Facebook GitHub Bot"
|
||||
- echo "machine github.com login facebook-github-bot" > ~/.netrc
|
||||
- npm install && cd website && GIT_USER=facebook-github-bot npm run publish-gh-pages
|
||||
- npm install && cd website && GIT_USER=facebook-github-bot USE_SSH=true npm run publish-gh-pages
|
||||
|
|
|
@ -16,7 +16,15 @@ const CIRCLE_BRANCH = process.env.CIRCLE_BRANCH;
|
|||
const CIRCLE_PROJECT_USERNAME = process.env.CIRCLE_PROJECT_USERNAME;
|
||||
const CIRCLE_PROJECT_REPONAME = process.env.CIRCLE_PROJECT_REPONAME;
|
||||
const CI_PULL_REQUEST = process.env.CI_PULL_REQUEST;
|
||||
const remoteBranch = `https://${GIT_USER}@github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}.git`;
|
||||
|
||||
const USE_SSH = process.env.USE_SSH;
|
||||
|
||||
let remoteBranch;
|
||||
if (USE_SSH === "true") {
|
||||
remoteBranch = `git@github.com:${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}.git`;
|
||||
} else {
|
||||
remoteBranch = `https://${GIT_USER}@github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}.git`;
|
||||
}
|
||||
|
||||
// build static html files, then push to gh-pages branch of specified repo
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue