mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-10 23:57:22 +02:00
Add dummy siteConfig.js for deploying, fixed indendation on publishing file (#285)
This commit is contained in:
parent
b47dae6ae1
commit
fd835116ee
2 changed files with 28 additions and 26 deletions
|
@ -74,33 +74,33 @@ Continuous integration (CI) services are typically used to perform routine tasks
|
|||
|
||||
If you're already using Circle CI for your project, all you need to do to enable automatic deployments is to configure Circle to run the `publish-gh-pages` script as part of the deployment step.
|
||||
|
||||
1. Ensure the GitHub account that will be set as the `GIT_USER` has `write` access to the repo that contains the documentation.
|
||||
1. Log into GitHub as the `GIT_USER`.
|
||||
1. Go to https://github.com/settings/tokens for the `GIT_USER` and generate a new [personal access token](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/), granting it full control of private repositories through the `repo` access scope. Store this token in a safe place, making sure to not share it with anyone. This token can be used to authenticate GitHub actions on your behalf in place of your GitHub password.
|
||||
1. Open your Circle CI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like https://circleci.com/gh/ORG/REPO/edit#env-vars, where "ORG/REPO" should be replaced with your own GitHub org/repo.
|
||||
1. Create a new environment variable named "GITHUB_TOKEN", using your newly generated access token as the value.
|
||||
1. Open your `circle.yml` file and add the following under the `machine:` section to tell Circle to use relatively recent versions of node and npm, replacing npm with yarn if applicable:
|
||||
1. Ensure the GitHub account that will be set as the `GIT_USER` has `write` access to the repo that contains the documentation.
|
||||
1. Log into GitHub as the `GIT_USER`.
|
||||
1. Go to https://github.com/settings/tokens for the `GIT_USER` and generate a new [personal access token](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/), granting it full control of private repositories through the `repo` access scope. Store this token in a safe place, making sure to not share it with anyone. This token can be used to authenticate GitHub actions on your behalf in place of your GitHub password.
|
||||
1. Open your Circle CI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like https://circleci.com/gh/ORG/REPO/edit#env-vars, where "ORG/REPO" should be replaced with your own GitHub org/repo.
|
||||
1. Create a new environment variable named "GITHUB_TOKEN", using your newly generated access token as the value.
|
||||
1. Open your `circle.yml` file and add the following under the `machine:` section to tell Circle to use relatively recent versions of node and npm, replacing npm with yarn if applicable:
|
||||
|
||||
```
|
||||
machine:
|
||||
node:
|
||||
version: 6.11.2
|
||||
npm:
|
||||
version: 3.10.10
|
||||
```
|
||||
```
|
||||
machine:
|
||||
node:
|
||||
version: 6.11.2
|
||||
npm:
|
||||
version: 3.10.10
|
||||
```
|
||||
|
||||
1. Then, add the following lines to the `deployment:` section. If you don't have a `deployment:` section, you can add it at the end of the file.
|
||||
1. Then, add the following lines to the `deployment:` section. If you don't have a `deployment:` section, you can add it at the end of the file.
|
||||
|
||||
```
|
||||
deployment:
|
||||
website:
|
||||
branch: master
|
||||
commands:
|
||||
- git config --global user.email "<GITHUB_USERNAME>@users.noreply.github.com"
|
||||
- git config --global user.name "<YOUR_NAME>"
|
||||
- echo "machine github.com login <GITHUB_USERNAME> password $GITHUB_TOKEN" > ~/.netrc
|
||||
- cd website && npm install && GIT_USER=<GIT_USER> npm run publish-gh-pages
|
||||
```
|
||||
```
|
||||
deployment:
|
||||
website:
|
||||
branch: master
|
||||
commands:
|
||||
- git config --global user.email "<GITHUB_USERNAME>@users.noreply.github.com"
|
||||
- git config --global user.name "<YOUR_NAME>"
|
||||
- echo "machine github.com login <GITHUB_USERNAME> password $GITHUB_TOKEN" > ~/.netrc
|
||||
- cd website && npm install && GIT_USER=<GIT_USER> npm run publish-gh-pages
|
||||
```
|
||||
|
||||
Make sure to replace `<GIT_USER>` with the actual username of the GitHub account that will be used to publish the documentation.
|
||||
|
||||
|
@ -114,7 +114,7 @@ Now, whenever a new commit lands in `master`, CircleCI will run your suite of te
|
|||
|
||||
#### Tips & Tricks
|
||||
|
||||
When initially deploying to a `gh-pages` branch using Circle CI, you may notice that some jobs triggered by commits to the `gh-pages` branch fail to run successfully due to a lack of tests. You can easily work around this by creating a basic Circle CI config with the following contents:
|
||||
When initially deploying to a `gh-pages` branch using Circle CI, you may notice that some jobs triggered by commits to the `gh-pages` branch fail to run successfully due to a lack of tests. You can easily work around this by creating a basic Circle CI config with the following contents:
|
||||
|
||||
```yml
|
||||
# Circle CI 2.0 Config File
|
||||
|
@ -129,4 +129,4 @@ jobs:
|
|||
-run: echo "Skipping tests on gh-pages branch"
|
||||
```
|
||||
|
||||
Save this file as `config.yml` and place it in a `.circleci` folder inside your `website/assets` folder.
|
||||
Save this file as `config.yml` and place it in a `.circleci` folder inside your `website/assets` folder.
|
||||
|
|
|
@ -42,6 +42,8 @@ const siteConfig = {
|
|||
'Copyright © ' +
|
||||
new Date().getFullYear() +
|
||||
' Your Name or Your Company Name',
|
||||
// organizationName: 'deltice', // or set an env variable ORGANIZATION_NAME
|
||||
// projectName: 'test-site', // or set an env variable PROJECT_NAME
|
||||
highlight: {
|
||||
// Highlight.js theme to use for syntax highlighting in code blocks
|
||||
theme: 'default',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue