mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-10 23:57:22 +02:00
parent
fa9edb266c
commit
b7af89b39f
1 changed files with 9 additions and 13 deletions
|
@ -65,27 +65,23 @@
|
|||
<li>Create a new environment variable named "GITHUB_TOKEN", using your newly generated access token as the value.</li>
|
||||
<li>Open your <code>circle.yml</code> file and add the following under the <code>machine:</code> section to tell Circle to use relatively recent versions of node and npm, replacing npm with yarn if applicable:</li>
|
||||
</ol>
|
||||
<pre><code class="hljs">```
|
||||
machine:
|
||||
node:
|
||||
version: 6.11.2
|
||||
<pre><code class="hljs">machine:
|
||||
<span class="hljs-keyword">node</span><span class="hljs-title">:
|
||||
version</span>: <span class="hljs-number">6.11</span>.<span class="hljs-number">2</span>
|
||||
npm:
|
||||
version: 3.10.10
|
||||
```
|
||||
<span class="hljs-keyword">version</span>: <span class="hljs-number">3.10</span>.<span class="hljs-number">10</span>
|
||||
</code></pre>
|
||||
<ol>
|
||||
<li>Then, add the following lines to the <code>deployment:</code> section. If you don't have a <code>deployment:</code> section, you can add it at the end of the file.</li>
|
||||
</ol>
|
||||
<pre><code class="hljs">```
|
||||
deployment:
|
||||
<pre><code class="hljs">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
|
||||
```
|
||||
- git<span class="hljs-built_in"> config </span>--global user.email <span class="hljs-string">"<GITHUB_USERNAME>@users.noreply.github.com"</span>
|
||||
- git<span class="hljs-built_in"> config </span>--global user.name <span class="hljs-string">"<YOUR_NAME>"</span>
|
||||
- echo <span class="hljs-string">"machine github.com login <GITHUB_USERNAME> password <span class="hljs-variable">$GITHUB_TOKEN</span>"</span> > ~/.netrc
|
||||
- cd website && npm install && <span class="hljs-attribute">GIT_USER</span>=<GIT_USER> npm <span class="hljs-builtin-name">run</span> publish-gh-pages
|
||||
</code></pre>
|
||||
<p>Make sure to replace <code><GIT_USER></code> with the actual username of the GitHub account that will be used to publish the documentation.</p>
|
||||
<p><strong>DO NOT</strong> place the actual value of <code>$GITHUB_TOKEN</code> in <code>circle.yml</code>. We already configured that as an environment variable back in Step 3.</p>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue