Update publishing docs and API information (#372)

Some environment variables can be set by the CircleCI build itself
Document `USE_SSH`
This commit is contained in:
Joel Marcey 2018-01-03 17:03:14 -08:00 committed by GitHub
parent efaa792206
commit 8e5b5c9f0f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 5 deletions

View file

@ -74,11 +74,26 @@ Alias: `publish-gh-pages`
[Builds](api-commands.md#docusaurus-build), then deploys the static website to GitHub Pages. This command is meant to be run during the deployment step in Circle CI, and therefore expects a few environment variables to be defined:
The following is generally set manually by the user in the CircleCI `config.yml` file.
- `GIT_USER`: The git user to be associated with the deploy commit.
- `USE_SSH`: Whether to use SSH instead of HTTPS for your connection to the GitHub repo.
e.g.,
```bash
GIT_USER=docusaurus-bot USE_SSH=true yarn run publish-gh-pages
```
The following are set by the [CircleCI environment](https://circleci.com/docs/1.0/environment-variables/) during the build process.
- `CIRCLE_BRANCH`: The git branch associated with the commit that triggered the CI run.
- `CI_PULL_REQUEST`: Expected to be truthy if the current CI run was triggered by a commit in a pull request.
The following should be set by you in `siteConfig.js` as `organizationName` and `projectName`, respectively. If they are not set in your site configuration, they fall back to the [CircleCI environment](https://circleci.com/docs/1.0/environment-variables/).
- `CIRCLE_PROJECT_USERNAME`: The GitHub username or organization name that hosts the git repo, e.g. "facebook".
- `CIRCLE_PROJECT_REPONAME`: The name of the git repo, e.g. "Docusaurus".
- `CI_PULL_REQUEST`: Expected to be truthy if the current CI run was triggered by a commit in a pull request.
You can learn more about configuring automatic deployments with CircleCI in the [Publishing guide](getting-started-publishing.md).