mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-10 07:37:19 +02:00
parent
78ba5612f7
commit
70a7a84644
3497 changed files with 716661 additions and 653 deletions
|
@ -1,4 +1,4 @@
|
|||
# Circle CI 2.0 Config File
|
||||
# CircleCI 2.0 Config File
|
||||
# This config file will prevent tests from being run on the gh-pages branch.
|
||||
version: 2
|
||||
jobs:
|
||||
|
@ -7,4 +7,4 @@ jobs:
|
|||
branches:
|
||||
ignore: gh-pages
|
||||
steps:
|
||||
-run: echo "Skipping tests on gh-pages branch"
|
||||
-run: echo "Skipping tests on gh-pages branch"
|
||||
|
|
|
@ -139,7 +139,7 @@
|
|||
CURRENT_BRANCH=master \
|
||||
yarn run publish-gh-pages
|
||||
</code></pre></li>
|
||||
<li><p>Configured Circle CI using the <a href="https://docusaurus.io/docs/en/publishing.html#automating-deployments-using-continuous-integration">provided Docusaurus instructions</a>. There were 2 PRs for this, <a href="https://github.com/facebookincubator/profilo/pull/8">the first</a>for the initial config and <a href="https://github.com/facebookincubator/profilo/pull/12">the second</a> to make sure Circle CI only triggered for changes in the master branch (thanks Joel Marcey!).</p></li>
|
||||
<li><p>Configured CircleCI using the <a href="https://docusaurus.io/docs/en/publishing.html#automating-deployments-using-continuous-integration">provided Docusaurus instructions</a>. There were 2 PRs for this, <a href="https://github.com/facebookincubator/profilo/pull/8">the first</a>for the initial config and <a href="https://github.com/facebookincubator/profilo/pull/12">the second</a> to make sure CircleCI only triggered for changes in the master branch (thanks Joel Marcey!).</p></li>
|
||||
</ol>
|
||||
<p>The final website was published on <a href="https://facebookincubator.github.io/profilo/">https://facebookincubator.github.io/profilo/</a>. It had taken 1.5 hours to get to the initial PR stage and another half an hour or so to respond to review feedback and publish the website.</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="design"></a><a href="#design" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Design</h2>
|
||||
|
|
|
@ -139,7 +139,7 @@
|
|||
CURRENT_BRANCH=master \
|
||||
yarn run publish-gh-pages
|
||||
</code></pre></li>
|
||||
<li><p>Configured Circle CI using the <a href="https://docusaurus.io/docs/en/publishing.html#automating-deployments-using-continuous-integration">provided Docusaurus instructions</a>. There were 2 PRs for this, <a href="https://github.com/facebookincubator/profilo/pull/8">the first</a>for the initial config and <a href="https://github.com/facebookincubator/profilo/pull/12">the second</a> to make sure Circle CI only triggered for changes in the master branch (thanks Joel Marcey!).</p></li>
|
||||
<li><p>Configured CircleCI using the <a href="https://docusaurus.io/docs/en/publishing.html#automating-deployments-using-continuous-integration">provided Docusaurus instructions</a>. There were 2 PRs for this, <a href="https://github.com/facebookincubator/profilo/pull/8">the first</a>for the initial config and <a href="https://github.com/facebookincubator/profilo/pull/12">the second</a> to make sure CircleCI only triggered for changes in the master branch (thanks Joel Marcey!).</p></li>
|
||||
</ol>
|
||||
<p>The final website was published on <a href="https://facebookincubator.github.io/profilo/">https://facebookincubator.github.io/profilo/</a>. It had taken 1.5 hours to get to the initial PR stage and another half an hour or so to respond to review feedback and publish the website.</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="design"></a><a href="#design" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Design</h2>
|
||||
|
|
|
@ -122,7 +122,7 @@
|
|||
<hr>
|
||||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-publish"></a><a href="#docusaurus-publish" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-publish</code></h3>
|
||||
<p>Alias: <code>publish-gh-pages</code></p>
|
||||
<p><a href="/docs/en/1.0.11/commands#docusaurus-build">Builds</a>, 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:</p>
|
||||
<p><a href="/docs/en/1.0.11/commands#docusaurus-build">Builds</a>, then deploys the static website to GitHub Pages. This command is meant to be run during the deployment step in CircleCI, and therefore expects a few environment variables to be defined:</p>
|
||||
<p>The following environment variables are generally set manually by the user in the CircleCI <code>config.yml</code> file.</p>
|
||||
<ul>
|
||||
<li><code>GIT_USER</code>: The git user to be associated with the deploy commit.</li>
|
||||
|
@ -160,7 +160,7 @@
|
|||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-write-translations"></a><a href="#docusaurus-write-translations" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-write-translations</code></h3>
|
||||
<p>Alias: <code>write-translations</code></p>
|
||||
<p>Writes the English for any strings that need to be translated into an <code>website/i18n/en.json</code> file. The script will go through every file in <code>website/pages/en</code> and through the <code>siteConfig.js</code> file and other config files to fetch English strings that will then be translated on Crowdin. See the <a href="/docs/en/1.0.11/translation">Translation guide</a> to learn more.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-4-8 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.0.11/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.0.11/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples-feature"><code>docusaurus-examples [feature]</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version-currentversion-newversion"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start-port-number"><code>docusaurus-start [--port ]</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.0.11/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.0.11/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples-feature"><code>docusaurus-examples [feature]</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version-currentversion-newversion"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start-port-number"><code>docusaurus-start [--port ]</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -122,7 +122,7 @@
|
|||
<hr>
|
||||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-publish"></a><a href="#docusaurus-publish" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-publish</code></h3>
|
||||
<p>Alias: <code>publish-gh-pages</code></p>
|
||||
<p><a href="/docs/en/1.0.11/commands#docusaurus-build">Builds</a>, 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:</p>
|
||||
<p><a href="/docs/en/1.0.11/commands#docusaurus-build">Builds</a>, then deploys the static website to GitHub Pages. This command is meant to be run during the deployment step in CircleCI, and therefore expects a few environment variables to be defined:</p>
|
||||
<p>The following environment variables are generally set manually by the user in the CircleCI <code>config.yml</code> file.</p>
|
||||
<ul>
|
||||
<li><code>GIT_USER</code>: The git user to be associated with the deploy commit.</li>
|
||||
|
@ -160,7 +160,7 @@
|
|||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-write-translations"></a><a href="#docusaurus-write-translations" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-write-translations</code></h3>
|
||||
<p>Alias: <code>write-translations</code></p>
|
||||
<p>Writes the English for any strings that need to be translated into an <code>website/i18n/en.json</code> file. The script will go through every file in <code>website/pages/en</code> and through the <code>siteConfig.js</code> file and other config files to fetch English strings that will then be translated on Crowdin. See the <a href="/docs/en/1.0.11/translation">Translation guide</a> to learn more.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-4-8 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.0.11/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.0.11/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples-feature"><code>docusaurus-examples [feature]</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version-currentversion-newversion"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start-port-number"><code>docusaurus-start [--port ]</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.0.11/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.0.11/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples-feature"><code>docusaurus-examples [feature]</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version-currentversion-newversion"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start-port-number"><code>docusaurus-start [--port ]</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -128,14 +128,14 @@
|
|||
<p>You can run the command above any time you update the docs and wish to deploy the changes to your site. Running the script manually may be fine for sites where the documentation rarely changes and it is not too much of an inconvenience to remember to manually deploy changes.</p>
|
||||
<p>However, you can automate the publishing process with continuous integration (CI).</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="automating-deployments-using-continuous-integration"></a><a href="#automating-deployments-using-continuous-integration" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Automating Deployments Using Continuous Integration</h2>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">Circle CI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circle-ci-20"></a><a href="#using-circle-ci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using Circle CI 2.0</h3>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">CircleCI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circleci-20"></a><a href="#using-circleci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using CircleCI 2.0</h3>
|
||||
<p>If you haven't done so already, you can <a href="https://circleci.com/signup/">setup CircleCI</a> for your open source project. Afterwards, in order to enable automatic deployment of your site and documentation via CircleCI, just configure Circle to run the <code>publish-gh-pages</code> script as part of the deployment step. You can follow the steps below to get that setup.</p>
|
||||
<ol>
|
||||
<li>Ensure the GitHub account that will be set as the <code>GIT_USER</code> has <code>write</code> access to the repo that contains the documentation, by checking <code>Settings | Collaborators & teams</code> in the repo.</li>
|
||||
<li>Log into GitHub as the <code>GIT_USER</code>.</li>
|
||||
<li>Go to <a href="https://github.com/settings/tokens">https://github.com/settings/tokens</a> for the <code>GIT_USER</code> and generate a new <a href="https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/">personal access token</a>, granting it full control of private repositories through the <code>repo</code> 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.</li>
|
||||
<li>Open your Circle CI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub org/repo.</li>
|
||||
<li>Open your CircleCI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub org/repo.</li>
|
||||
<li>Create a new environment variable named <code>GITHUB_TOKEN</code>, using your newly generated access token as the value.</li>
|
||||
<li>Create a <code>.circleci</code> folder and create a <code>config.yml</code> under that folder.</li>
|
||||
<li>Copy the text below into <code>.circleci/config.yml</code>.</li>
|
||||
|
@ -171,7 +171,7 @@
|
|||
<span class="hljs-attr"> build_and_deploy:</span>
|
||||
<span class="hljs-attr"> jobs:</span>
|
||||
<span class="hljs-attr"> - deploy-website:</span>
|
||||
<span class="hljs-comment"># filters: *filter-only-master </span>
|
||||
<span class="hljs-comment"># filters: *filter-only-master</span>
|
||||
</code></pre>
|
||||
<p>Make sure to replace all <code><....></code> in the <code>command:</code> sequence with appropriate values. For <code><GIT_USER></code>, it should be a GitHub account that has access to push documentation to your GitHub repo. Many times <code><GIT_USER></code> and <code><GITHUB_USERNAME></code> will be the same.</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>
|
||||
|
@ -183,11 +183,11 @@
|
|||
</blockquote>
|
||||
<p>Now, whenever a new commit lands in <code>master</code>, CircleCI will run your suite of tests and, if everything passes, your website will be deployed via the <code>publish-gh-pages</code> script.</p>
|
||||
<blockquote>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the Circle CI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the CircleCI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
</blockquote>
|
||||
<h3><a class="anchor" aria-hidden="true" id="tips-tricks"></a><a href="#tips-tricks" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Tips & Tricks</h3>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using Circle CI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> 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:</p>
|
||||
<pre><code class="hljs css language-yml"><span class="hljs-comment"># Circle CI 2.0 Config File</span>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using CircleCI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> branch fail to run successfully due to a lack of tests. You can easily work around this by creating a basic CircleCI config with the following contents:</p>
|
||||
<pre><code class="hljs css language-yml"><span class="hljs-comment"># CircleCI 2.0 Config File</span>
|
||||
<span class="hljs-comment"># This config file will prevent tests from being run on the gh-pages branch.</span>
|
||||
<span class="hljs-attr">version:</span> <span class="hljs-number">2</span>
|
||||
<span class="hljs-attr">jobs:</span>
|
||||
|
@ -199,7 +199,7 @@
|
|||
<span class="hljs-attr"> -run:</span> <span class="hljs-string">echo</span> <span class="hljs-string">"Skipping tests on gh-pages branch"</span>
|
||||
</code></pre>
|
||||
<p>Save this file as <code>config.yml</code> and place it in a <code>.circleci</code> folder inside your <code>website/assets</code> folder.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-4-8 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.0.11/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.0.11/blog"><span>Next</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circle-ci-20">Using Circle CI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.0.11/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.0.11/blog"><span>Next</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circleci-20">Using CircleCI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -128,14 +128,14 @@
|
|||
<p>You can run the command above any time you update the docs and wish to deploy the changes to your site. Running the script manually may be fine for sites where the documentation rarely changes and it is not too much of an inconvenience to remember to manually deploy changes.</p>
|
||||
<p>However, you can automate the publishing process with continuous integration (CI).</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="automating-deployments-using-continuous-integration"></a><a href="#automating-deployments-using-continuous-integration" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Automating Deployments Using Continuous Integration</h2>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">Circle CI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circle-ci-20"></a><a href="#using-circle-ci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using Circle CI 2.0</h3>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">CircleCI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circleci-20"></a><a href="#using-circleci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using CircleCI 2.0</h3>
|
||||
<p>If you haven't done so already, you can <a href="https://circleci.com/signup/">setup CircleCI</a> for your open source project. Afterwards, in order to enable automatic deployment of your site and documentation via CircleCI, just configure Circle to run the <code>publish-gh-pages</code> script as part of the deployment step. You can follow the steps below to get that setup.</p>
|
||||
<ol>
|
||||
<li>Ensure the GitHub account that will be set as the <code>GIT_USER</code> has <code>write</code> access to the repo that contains the documentation, by checking <code>Settings | Collaborators & teams</code> in the repo.</li>
|
||||
<li>Log into GitHub as the <code>GIT_USER</code>.</li>
|
||||
<li>Go to <a href="https://github.com/settings/tokens">https://github.com/settings/tokens</a> for the <code>GIT_USER</code> and generate a new <a href="https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/">personal access token</a>, granting it full control of private repositories through the <code>repo</code> 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.</li>
|
||||
<li>Open your Circle CI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub org/repo.</li>
|
||||
<li>Open your CircleCI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub org/repo.</li>
|
||||
<li>Create a new environment variable named <code>GITHUB_TOKEN</code>, using your newly generated access token as the value.</li>
|
||||
<li>Create a <code>.circleci</code> folder and create a <code>config.yml</code> under that folder.</li>
|
||||
<li>Copy the text below into <code>.circleci/config.yml</code>.</li>
|
||||
|
@ -171,7 +171,7 @@
|
|||
<span class="hljs-attr"> build_and_deploy:</span>
|
||||
<span class="hljs-attr"> jobs:</span>
|
||||
<span class="hljs-attr"> - deploy-website:</span>
|
||||
<span class="hljs-comment"># filters: *filter-only-master </span>
|
||||
<span class="hljs-comment"># filters: *filter-only-master</span>
|
||||
</code></pre>
|
||||
<p>Make sure to replace all <code><....></code> in the <code>command:</code> sequence with appropriate values. For <code><GIT_USER></code>, it should be a GitHub account that has access to push documentation to your GitHub repo. Many times <code><GIT_USER></code> and <code><GITHUB_USERNAME></code> will be the same.</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>
|
||||
|
@ -183,11 +183,11 @@
|
|||
</blockquote>
|
||||
<p>Now, whenever a new commit lands in <code>master</code>, CircleCI will run your suite of tests and, if everything passes, your website will be deployed via the <code>publish-gh-pages</code> script.</p>
|
||||
<blockquote>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the Circle CI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the CircleCI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
</blockquote>
|
||||
<h3><a class="anchor" aria-hidden="true" id="tips-tricks"></a><a href="#tips-tricks" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Tips & Tricks</h3>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using Circle CI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> 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:</p>
|
||||
<pre><code class="hljs css language-yml"><span class="hljs-comment"># Circle CI 2.0 Config File</span>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using CircleCI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> branch fail to run successfully due to a lack of tests. You can easily work around this by creating a basic CircleCI config with the following contents:</p>
|
||||
<pre><code class="hljs css language-yml"><span class="hljs-comment"># CircleCI 2.0 Config File</span>
|
||||
<span class="hljs-comment"># This config file will prevent tests from being run on the gh-pages branch.</span>
|
||||
<span class="hljs-attr">version:</span> <span class="hljs-number">2</span>
|
||||
<span class="hljs-attr">jobs:</span>
|
||||
|
@ -199,7 +199,7 @@
|
|||
<span class="hljs-attr"> -run:</span> <span class="hljs-string">echo</span> <span class="hljs-string">"Skipping tests on gh-pages branch"</span>
|
||||
</code></pre>
|
||||
<p>Save this file as <code>config.yml</code> and place it in a <code>.circleci</code> folder inside your <code>website/assets</code> folder.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-4-8 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.0.11/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.0.11/blog"><span>Next</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circle-ci-20">Using Circle CI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.0.11/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.0.11/blog"><span>Next</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circleci-20">Using CircleCI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -122,7 +122,7 @@
|
|||
<hr>
|
||||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-publish"></a><a href="#docusaurus-publish" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-publish</code></h3>
|
||||
<p>Alias: <code>publish-gh-pages</code></p>
|
||||
<p><a href="/docs/en/1.0.12/commands#docusaurus-build">Builds</a>, 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:</p>
|
||||
<p><a href="/docs/en/1.0.12/commands#docusaurus-build">Builds</a>, then deploys the static website to GitHub Pages. This command is meant to be run during the deployment step in CircleCI, and therefore expects a few environment variables to be defined:</p>
|
||||
<p>The following environment variables are generally set manually by the user in the CircleCI <code>config.yml</code> file.</p>
|
||||
<ul>
|
||||
<li><code>GIT_USER</code>: The git user to be associated with the deploy commit.</li>
|
||||
|
@ -160,7 +160,7 @@
|
|||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-write-translations"></a><a href="#docusaurus-write-translations" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-write-translations</code></h3>
|
||||
<p>Alias: <code>write-translations</code></p>
|
||||
<p>Writes the English for any strings that need to be translated into an <code>website/i18n/en.json</code> file. The script will go through every file in <code>website/pages/en</code> and through the <code>siteConfig.js</code> file and other config files to fetch English strings that will then be translated on Crowdin. See the <a href="/docs/en/1.0.12/translation">Translation guide</a> to learn more.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-4-8 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.0.12/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.0.12/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples-feature"><code>docusaurus-examples [feature]</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version-currentversion-newversion"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start-port-number"><code>docusaurus-start [--port ]</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.0.12/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.0.12/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples-feature"><code>docusaurus-examples [feature]</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version-currentversion-newversion"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start-port-number"><code>docusaurus-start [--port ]</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -122,7 +122,7 @@
|
|||
<hr>
|
||||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-publish"></a><a href="#docusaurus-publish" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-publish</code></h3>
|
||||
<p>Alias: <code>publish-gh-pages</code></p>
|
||||
<p><a href="/docs/en/1.0.12/commands#docusaurus-build">Builds</a>, 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:</p>
|
||||
<p><a href="/docs/en/1.0.12/commands#docusaurus-build">Builds</a>, then deploys the static website to GitHub Pages. This command is meant to be run during the deployment step in CircleCI, and therefore expects a few environment variables to be defined:</p>
|
||||
<p>The following environment variables are generally set manually by the user in the CircleCI <code>config.yml</code> file.</p>
|
||||
<ul>
|
||||
<li><code>GIT_USER</code>: The git user to be associated with the deploy commit.</li>
|
||||
|
@ -160,7 +160,7 @@
|
|||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-write-translations"></a><a href="#docusaurus-write-translations" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-write-translations</code></h3>
|
||||
<p>Alias: <code>write-translations</code></p>
|
||||
<p>Writes the English for any strings that need to be translated into an <code>website/i18n/en.json</code> file. The script will go through every file in <code>website/pages/en</code> and through the <code>siteConfig.js</code> file and other config files to fetch English strings that will then be translated on Crowdin. See the <a href="/docs/en/1.0.12/translation">Translation guide</a> to learn more.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-4-8 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.0.12/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.0.12/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples-feature"><code>docusaurus-examples [feature]</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version-currentversion-newversion"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start-port-number"><code>docusaurus-start [--port ]</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.0.12/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.0.12/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples-feature"><code>docusaurus-examples [feature]</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version-currentversion-newversion"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start-port-number"><code>docusaurus-start [--port ]</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -143,14 +143,14 @@
|
|||
<p>You can run the command above any time you update the docs and wish to deploy the changes to your site. Running the script manually may be fine for sites where the documentation rarely changes and it is not too much of an inconvenience to remember to manually deploy changes.</p>
|
||||
<p>However, you can automate the publishing process with continuous integration (CI).</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="automating-deployments-using-continuous-integration"></a><a href="#automating-deployments-using-continuous-integration" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Automating Deployments Using Continuous Integration</h2>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">Circle CI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circle-ci-20"></a><a href="#using-circle-ci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using Circle CI 2.0</h3>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">CircleCI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circleci-20"></a><a href="#using-circleci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using CircleCI 2.0</h3>
|
||||
<p>If you haven't done so already, you can <a href="https://circleci.com/signup/">setup CircleCI</a> for your open source project. Afterwards, in order to enable automatic deployment of your site and documentation via CircleCI, just configure Circle to run the <code>publish-gh-pages</code> script as part of the deployment step. You can follow the steps below to get that setup.</p>
|
||||
<ol>
|
||||
<li>Ensure the GitHub account that will be set as the <code>GIT_USER</code> has <code>write</code> access to the repo that contains the documentation, by checking <code>Settings | Collaborators & teams</code> in the repo.</li>
|
||||
<li>Log into GitHub as the <code>GIT_USER</code>.</li>
|
||||
<li>Go to <a href="https://github.com/settings/tokens">https://github.com/settings/tokens</a> for the <code>GIT_USER</code> and generate a new <a href="https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/">personal access token</a>, granting it full control of private repositories through the <code>repo</code> 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.</li>
|
||||
<li>Open your Circle CI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub org/repo.</li>
|
||||
<li>Open your CircleCI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub org/repo.</li>
|
||||
<li>Create a new environment variable named <code>GITHUB_TOKEN</code>, using your newly generated access token as the value.</li>
|
||||
<li>Create a <code>.circleci</code> folder and create a <code>config.yml</code> under that folder.</li>
|
||||
<li>Copy the text below into <code>.circleci/config.yml</code>.</li>
|
||||
|
@ -198,11 +198,11 @@
|
|||
</blockquote>
|
||||
<p>Now, whenever a new commit lands in <code>master</code>, CircleCI will run your suite of tests and, if everything passes, your website will be deployed via the <code>publish-gh-pages</code> script.</p>
|
||||
<blockquote>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the Circle CI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the CircleCI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
</blockquote>
|
||||
<h3><a class="anchor" aria-hidden="true" id="tips-tricks"></a><a href="#tips-tricks" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Tips & Tricks</h3>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using Circle CI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> 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:</p>
|
||||
<pre><code class="hljs css language-yml"><span class="hljs-comment"># Circle CI 2.0 Config File</span>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using CircleCI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> branch fail to run successfully due to a lack of tests. You can easily work around this by creating a basic CircleCI config with the following contents:</p>
|
||||
<pre><code class="hljs css language-yml"><span class="hljs-comment"># CircleCI 2.0 Config File</span>
|
||||
<span class="hljs-comment"># This config file will prevent tests from being run on the gh-pages branch.</span>
|
||||
<span class="hljs-attr">version:</span> <span class="hljs-number">2</span>
|
||||
<span class="hljs-attr">jobs:</span>
|
||||
|
@ -214,7 +214,7 @@
|
|||
<span class="hljs-attr"> -run:</span> <span class="hljs-string">echo</span> <span class="hljs-string">"Skipping tests on gh-pages branch"</span>
|
||||
</code></pre>
|
||||
<p>Save this file as <code>config.yml</code> and place it in a <code>.circleci</code> folder inside your <code>website/assets</code> folder.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-4-14 by Kaveh Khorram</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.0.12/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.0.12/blog"><span>Next</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circle-ci-20">Using Circle CI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.0.12/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.0.12/blog"><span>Next</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circleci-20">Using CircleCI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -143,14 +143,14 @@
|
|||
<p>You can run the command above any time you update the docs and wish to deploy the changes to your site. Running the script manually may be fine for sites where the documentation rarely changes and it is not too much of an inconvenience to remember to manually deploy changes.</p>
|
||||
<p>However, you can automate the publishing process with continuous integration (CI).</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="automating-deployments-using-continuous-integration"></a><a href="#automating-deployments-using-continuous-integration" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Automating Deployments Using Continuous Integration</h2>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">Circle CI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circle-ci-20"></a><a href="#using-circle-ci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using Circle CI 2.0</h3>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">CircleCI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circleci-20"></a><a href="#using-circleci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using CircleCI 2.0</h3>
|
||||
<p>If you haven't done so already, you can <a href="https://circleci.com/signup/">setup CircleCI</a> for your open source project. Afterwards, in order to enable automatic deployment of your site and documentation via CircleCI, just configure Circle to run the <code>publish-gh-pages</code> script as part of the deployment step. You can follow the steps below to get that setup.</p>
|
||||
<ol>
|
||||
<li>Ensure the GitHub account that will be set as the <code>GIT_USER</code> has <code>write</code> access to the repo that contains the documentation, by checking <code>Settings | Collaborators & teams</code> in the repo.</li>
|
||||
<li>Log into GitHub as the <code>GIT_USER</code>.</li>
|
||||
<li>Go to <a href="https://github.com/settings/tokens">https://github.com/settings/tokens</a> for the <code>GIT_USER</code> and generate a new <a href="https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/">personal access token</a>, granting it full control of private repositories through the <code>repo</code> 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.</li>
|
||||
<li>Open your Circle CI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub org/repo.</li>
|
||||
<li>Open your CircleCI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub org/repo.</li>
|
||||
<li>Create a new environment variable named <code>GITHUB_TOKEN</code>, using your newly generated access token as the value.</li>
|
||||
<li>Create a <code>.circleci</code> folder and create a <code>config.yml</code> under that folder.</li>
|
||||
<li>Copy the text below into <code>.circleci/config.yml</code>.</li>
|
||||
|
@ -198,11 +198,11 @@
|
|||
</blockquote>
|
||||
<p>Now, whenever a new commit lands in <code>master</code>, CircleCI will run your suite of tests and, if everything passes, your website will be deployed via the <code>publish-gh-pages</code> script.</p>
|
||||
<blockquote>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the Circle CI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the CircleCI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
</blockquote>
|
||||
<h3><a class="anchor" aria-hidden="true" id="tips-tricks"></a><a href="#tips-tricks" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Tips & Tricks</h3>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using Circle CI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> 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:</p>
|
||||
<pre><code class="hljs css language-yml"><span class="hljs-comment"># Circle CI 2.0 Config File</span>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using CircleCI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> branch fail to run successfully due to a lack of tests. You can easily work around this by creating a basic CircleCI config with the following contents:</p>
|
||||
<pre><code class="hljs css language-yml"><span class="hljs-comment"># CircleCI 2.0 Config File</span>
|
||||
<span class="hljs-comment"># This config file will prevent tests from being run on the gh-pages branch.</span>
|
||||
<span class="hljs-attr">version:</span> <span class="hljs-number">2</span>
|
||||
<span class="hljs-attr">jobs:</span>
|
||||
|
@ -214,7 +214,7 @@
|
|||
<span class="hljs-attr"> -run:</span> <span class="hljs-string">echo</span> <span class="hljs-string">"Skipping tests on gh-pages branch"</span>
|
||||
</code></pre>
|
||||
<p>Save this file as <code>config.yml</code> and place it in a <code>.circleci</code> folder inside your <code>website/assets</code> folder.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-4-14 by Kaveh Khorram</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.0.12/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.0.12/blog"><span>Next</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circle-ci-20">Using Circle CI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.0.12/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.0.12/blog"><span>Next</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circleci-20">Using CircleCI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -122,7 +122,7 @@
|
|||
<hr>
|
||||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-publish"></a><a href="#docusaurus-publish" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-publish</code></h3>
|
||||
<p>Alias: <code>publish-gh-pages</code></p>
|
||||
<p><a href="/docs/en/1.0.13/commands#docusaurus-build">Builds</a>, 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:</p>
|
||||
<p><a href="/docs/en/1.0.13/commands#docusaurus-build">Builds</a>, then deploys the static website to GitHub Pages. This command is meant to be run during the deployment step in CircleCI, and therefore expects a few environment variables to be defined:</p>
|
||||
<p>The following environment variables are generally set manually by the user in the CircleCI <code>config.yml</code> file.</p>
|
||||
<ul>
|
||||
<li><code>GIT_USER</code>: The git user to be associated with the deploy commit.</li>
|
||||
|
@ -160,7 +160,7 @@
|
|||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-write-translations"></a><a href="#docusaurus-write-translations" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-write-translations</code></h3>
|
||||
<p>Alias: <code>write-translations</code></p>
|
||||
<p>Writes the English for any strings that need to be translated into an <code>website/i18n/en.json</code> file. The script will go through every file in <code>website/pages/en</code> and through the <code>siteConfig.js</code> file and other config files to fetch English strings that will then be translated on Crowdin. See the <a href="/docs/en/1.0.13/translation">Translation guide</a> to learn more.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-4-8 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.0.13/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.0.13/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples-feature"><code>docusaurus-examples [feature]</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version-currentversion-newversion"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start-port-number"><code>docusaurus-start [--port ]</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.0.13/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.0.13/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples-feature"><code>docusaurus-examples [feature]</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version-currentversion-newversion"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start-port-number"><code>docusaurus-start [--port ]</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -122,7 +122,7 @@
|
|||
<hr>
|
||||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-publish"></a><a href="#docusaurus-publish" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-publish</code></h3>
|
||||
<p>Alias: <code>publish-gh-pages</code></p>
|
||||
<p><a href="/docs/en/1.0.13/commands#docusaurus-build">Builds</a>, 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:</p>
|
||||
<p><a href="/docs/en/1.0.13/commands#docusaurus-build">Builds</a>, then deploys the static website to GitHub Pages. This command is meant to be run during the deployment step in CircleCI, and therefore expects a few environment variables to be defined:</p>
|
||||
<p>The following environment variables are generally set manually by the user in the CircleCI <code>config.yml</code> file.</p>
|
||||
<ul>
|
||||
<li><code>GIT_USER</code>: The git user to be associated with the deploy commit.</li>
|
||||
|
@ -160,7 +160,7 @@
|
|||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-write-translations"></a><a href="#docusaurus-write-translations" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-write-translations</code></h3>
|
||||
<p>Alias: <code>write-translations</code></p>
|
||||
<p>Writes the English for any strings that need to be translated into an <code>website/i18n/en.json</code> file. The script will go through every file in <code>website/pages/en</code> and through the <code>siteConfig.js</code> file and other config files to fetch English strings that will then be translated on Crowdin. See the <a href="/docs/en/1.0.13/translation">Translation guide</a> to learn more.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-4-8 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.0.13/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.0.13/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples-feature"><code>docusaurus-examples [feature]</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version-currentversion-newversion"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start-port-number"><code>docusaurus-start [--port ]</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.0.13/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.0.13/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples-feature"><code>docusaurus-examples [feature]</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version-currentversion-newversion"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start-port-number"><code>docusaurus-start [--port ]</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -143,14 +143,14 @@
|
|||
<p>You can run the command above any time you update the docs and wish to deploy the changes to your site. Running the script manually may be fine for sites where the documentation rarely changes and it is not too much of an inconvenience to remember to manually deploy changes.</p>
|
||||
<p>However, you can automate the publishing process with continuous integration (CI).</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="automating-deployments-using-continuous-integration"></a><a href="#automating-deployments-using-continuous-integration" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Automating Deployments Using Continuous Integration</h2>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">Circle CI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circle-ci-20"></a><a href="#using-circle-ci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using Circle CI 2.0</h3>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">CircleCI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circleci-20"></a><a href="#using-circleci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using CircleCI 2.0</h3>
|
||||
<p>If you haven't done so already, you can <a href="https://circleci.com/signup/">setup CircleCI</a> for your open source project. Afterwards, in order to enable automatic deployment of your site and documentation via CircleCI, just configure Circle to run the <code>publish-gh-pages</code> script as part of the deployment step. You can follow the steps below to get that setup.</p>
|
||||
<ol>
|
||||
<li>Ensure the GitHub account that will be set as the <code>GIT_USER</code> has <code>write</code> access to the repo that contains the documentation, by checking <code>Settings | Collaborators & teams</code> in the repo.</li>
|
||||
<li>Log into GitHub as the <code>GIT_USER</code>.</li>
|
||||
<li>Go to <a href="https://github.com/settings/tokens">https://github.com/settings/tokens</a> for the <code>GIT_USER</code> and generate a new <a href="https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/">personal access token</a>, granting it full control of private repositories through the <code>repo</code> 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.</li>
|
||||
<li>Open your Circle CI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub org/repo.</li>
|
||||
<li>Open your CircleCI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub org/repo.</li>
|
||||
<li>Create a new environment variable named <code>GITHUB_TOKEN</code>, using your newly generated access token as the value.</li>
|
||||
<li>Create a <code>.circleci</code> folder and create a <code>config.yml</code> under that folder.</li>
|
||||
<li>Copy the text below into <code>.circleci/config.yml</code>.</li>
|
||||
|
@ -198,11 +198,11 @@
|
|||
</blockquote>
|
||||
<p>Now, whenever a new commit lands in <code>master</code>, CircleCI will run your suite of tests and, if everything passes, your website will be deployed via the <code>publish-gh-pages</code> script.</p>
|
||||
<blockquote>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the Circle CI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the CircleCI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
</blockquote>
|
||||
<h3><a class="anchor" aria-hidden="true" id="tips-tricks"></a><a href="#tips-tricks" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Tips & Tricks</h3>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using Circle CI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> 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:</p>
|
||||
<pre><code class="hljs css language-yml"><span class="hljs-comment"># Circle CI 2.0 Config File</span>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using CircleCI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> branch fail to run successfully due to a lack of tests. You can easily work around this by creating a basic CircleCI config with the following contents:</p>
|
||||
<pre><code class="hljs css language-yml"><span class="hljs-comment"># CircleCI 2.0 Config File</span>
|
||||
<span class="hljs-comment"># This config file will prevent tests from being run on the gh-pages branch.</span>
|
||||
<span class="hljs-attr">version:</span> <span class="hljs-number">2</span>
|
||||
<span class="hljs-attr">jobs:</span>
|
||||
|
@ -214,7 +214,7 @@
|
|||
<span class="hljs-attr"> -run:</span> <span class="hljs-string">echo</span> <span class="hljs-string">"Skipping tests on gh-pages branch"</span>
|
||||
</code></pre>
|
||||
<p>Save this file as <code>config.yml</code> and place it in a <code>.circleci</code> folder inside your <code>website/assets</code> folder.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-4-14 by Kaveh Khorram</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.0.13/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.0.13/blog"><span>Next</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circle-ci-20">Using Circle CI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.0.13/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.0.13/blog"><span>Next</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circleci-20">Using CircleCI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -143,14 +143,14 @@
|
|||
<p>You can run the command above any time you update the docs and wish to deploy the changes to your site. Running the script manually may be fine for sites where the documentation rarely changes and it is not too much of an inconvenience to remember to manually deploy changes.</p>
|
||||
<p>However, you can automate the publishing process with continuous integration (CI).</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="automating-deployments-using-continuous-integration"></a><a href="#automating-deployments-using-continuous-integration" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Automating Deployments Using Continuous Integration</h2>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">Circle CI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circle-ci-20"></a><a href="#using-circle-ci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using Circle CI 2.0</h3>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">CircleCI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circleci-20"></a><a href="#using-circleci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using CircleCI 2.0</h3>
|
||||
<p>If you haven't done so already, you can <a href="https://circleci.com/signup/">setup CircleCI</a> for your open source project. Afterwards, in order to enable automatic deployment of your site and documentation via CircleCI, just configure Circle to run the <code>publish-gh-pages</code> script as part of the deployment step. You can follow the steps below to get that setup.</p>
|
||||
<ol>
|
||||
<li>Ensure the GitHub account that will be set as the <code>GIT_USER</code> has <code>write</code> access to the repo that contains the documentation, by checking <code>Settings | Collaborators & teams</code> in the repo.</li>
|
||||
<li>Log into GitHub as the <code>GIT_USER</code>.</li>
|
||||
<li>Go to <a href="https://github.com/settings/tokens">https://github.com/settings/tokens</a> for the <code>GIT_USER</code> and generate a new <a href="https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/">personal access token</a>, granting it full control of private repositories through the <code>repo</code> 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.</li>
|
||||
<li>Open your Circle CI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub org/repo.</li>
|
||||
<li>Open your CircleCI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub org/repo.</li>
|
||||
<li>Create a new environment variable named <code>GITHUB_TOKEN</code>, using your newly generated access token as the value.</li>
|
||||
<li>Create a <code>.circleci</code> folder and create a <code>config.yml</code> under that folder.</li>
|
||||
<li>Copy the text below into <code>.circleci/config.yml</code>.</li>
|
||||
|
@ -198,11 +198,11 @@
|
|||
</blockquote>
|
||||
<p>Now, whenever a new commit lands in <code>master</code>, CircleCI will run your suite of tests and, if everything passes, your website will be deployed via the <code>publish-gh-pages</code> script.</p>
|
||||
<blockquote>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the Circle CI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the CircleCI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
</blockquote>
|
||||
<h3><a class="anchor" aria-hidden="true" id="tips-tricks"></a><a href="#tips-tricks" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Tips & Tricks</h3>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using Circle CI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> 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:</p>
|
||||
<pre><code class="hljs css language-yml"><span class="hljs-comment"># Circle CI 2.0 Config File</span>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using CircleCI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> branch fail to run successfully due to a lack of tests. You can easily work around this by creating a basic CircleCI config with the following contents:</p>
|
||||
<pre><code class="hljs css language-yml"><span class="hljs-comment"># CircleCI 2.0 Config File</span>
|
||||
<span class="hljs-comment"># This config file will prevent tests from being run on the gh-pages branch.</span>
|
||||
<span class="hljs-attr">version:</span> <span class="hljs-number">2</span>
|
||||
<span class="hljs-attr">jobs:</span>
|
||||
|
@ -214,7 +214,7 @@
|
|||
<span class="hljs-attr"> -run:</span> <span class="hljs-string">echo</span> <span class="hljs-string">"Skipping tests on gh-pages branch"</span>
|
||||
</code></pre>
|
||||
<p>Save this file as <code>config.yml</code> and place it in a <code>.circleci</code> folder inside your <code>website/assets</code> folder.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-4-14 by Kaveh Khorram</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.0.13/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.0.13/blog"><span>Next</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circle-ci-20">Using Circle CI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.0.13/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.0.13/blog"><span>Next</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circleci-20">Using CircleCI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -122,7 +122,7 @@
|
|||
<hr>
|
||||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-publish"></a><a href="#docusaurus-publish" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-publish</code></h3>
|
||||
<p>Alias: <code>publish-gh-pages</code></p>
|
||||
<p><a href="/docs/en/1.0.14/commands#docusaurus-build">Builds</a>, 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:</p>
|
||||
<p><a href="/docs/en/1.0.14/commands#docusaurus-build">Builds</a>, then deploys the static website to GitHub Pages. This command is meant to be run during the deployment step in CircleCI, and therefore expects a few environment variables to be defined:</p>
|
||||
<p>The following environment variables are generally set manually by the user in the CircleCI <code>config.yml</code> file.</p>
|
||||
<ul>
|
||||
<li><code>GIT_USER</code>: The git user to be associated with the deploy commit.</li>
|
||||
|
@ -160,7 +160,7 @@
|
|||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-write-translations"></a><a href="#docusaurus-write-translations" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-write-translations</code></h3>
|
||||
<p>Alias: <code>write-translations</code></p>
|
||||
<p>Writes the English for any strings that need to be translated into an <code>website/i18n/en.json</code> file. The script will go through every file in <code>website/pages/en</code> and through the <code>siteConfig.js</code> file and other config files to fetch English strings that will then be translated on Crowdin. See the <a href="/docs/en/1.0.14/translation">Translation guide</a> to learn more.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-4-8 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.0.14/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.0.14/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples-feature"><code>docusaurus-examples [feature]</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version-currentversion-newversion"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start-port-number"><code>docusaurus-start [--port ]</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.0.14/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.0.14/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples-feature"><code>docusaurus-examples [feature]</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version-currentversion-newversion"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start-port-number"><code>docusaurus-start [--port ]</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -122,7 +122,7 @@
|
|||
<hr>
|
||||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-publish"></a><a href="#docusaurus-publish" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-publish</code></h3>
|
||||
<p>Alias: <code>publish-gh-pages</code></p>
|
||||
<p><a href="/docs/en/1.0.14/commands#docusaurus-build">Builds</a>, 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:</p>
|
||||
<p><a href="/docs/en/1.0.14/commands#docusaurus-build">Builds</a>, then deploys the static website to GitHub Pages. This command is meant to be run during the deployment step in CircleCI, and therefore expects a few environment variables to be defined:</p>
|
||||
<p>The following environment variables are generally set manually by the user in the CircleCI <code>config.yml</code> file.</p>
|
||||
<ul>
|
||||
<li><code>GIT_USER</code>: The git user to be associated with the deploy commit.</li>
|
||||
|
@ -160,7 +160,7 @@
|
|||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-write-translations"></a><a href="#docusaurus-write-translations" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-write-translations</code></h3>
|
||||
<p>Alias: <code>write-translations</code></p>
|
||||
<p>Writes the English for any strings that need to be translated into an <code>website/i18n/en.json</code> file. The script will go through every file in <code>website/pages/en</code> and through the <code>siteConfig.js</code> file and other config files to fetch English strings that will then be translated on Crowdin. See the <a href="/docs/en/1.0.14/translation">Translation guide</a> to learn more.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-4-8 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.0.14/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.0.14/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples-feature"><code>docusaurus-examples [feature]</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version-currentversion-newversion"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start-port-number"><code>docusaurus-start [--port ]</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.0.14/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.0.14/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples-feature"><code>docusaurus-examples [feature]</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version-currentversion-newversion"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start-port-number"><code>docusaurus-start [--port ]</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -148,14 +148,14 @@
|
|||
<p>You can run the command above any time you update the docs and wish to deploy the changes to your site. Running the script manually may be fine for sites where the documentation rarely changes and it is not too much of an inconvenience to remember to manually deploy changes.</p>
|
||||
<p>However, you can automate the publishing process with continuous integration (CI).</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="automating-deployments-using-continuous-integration"></a><a href="#automating-deployments-using-continuous-integration" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Automating Deployments Using Continuous Integration</h2>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">Circle CI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circle-ci-20"></a><a href="#using-circle-ci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using Circle CI 2.0</h3>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">CircleCI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circleci-20"></a><a href="#using-circleci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using CircleCI 2.0</h3>
|
||||
<p>If you haven't done so already, you can <a href="https://circleci.com/signup/">setup CircleCI</a> for your open source project. Afterwards, in order to enable automatic deployment of your site and documentation via CircleCI, just configure Circle to run the <code>publish-gh-pages</code> script as part of the deployment step. You can follow the steps below to get that setup.</p>
|
||||
<ol>
|
||||
<li>Ensure the GitHub account that will be set as the <code>GIT_USER</code> has <code>write</code> access to the repo that contains the documentation, by checking <code>Settings | Collaborators & teams</code> in the repo.</li>
|
||||
<li>Log into GitHub as the <code>GIT_USER</code>.</li>
|
||||
<li>Go to <a href="https://github.com/settings/tokens">https://github.com/settings/tokens</a> for the <code>GIT_USER</code> and generate a new <a href="https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/">personal access token</a>, granting it full control of private repositories through the <code>repo</code> 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.</li>
|
||||
<li>Open your Circle CI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub org/repo.</li>
|
||||
<li>Open your CircleCI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub org/repo.</li>
|
||||
<li>Create a new environment variable named <code>GITHUB_TOKEN</code>, using your newly generated access token as the value.</li>
|
||||
<li>Create a <code>.circleci</code> folder and create a <code>config.yml</code> under that folder.</li>
|
||||
<li>Copy the text below into <code>.circleci/config.yml</code>.</li>
|
||||
|
@ -203,11 +203,11 @@
|
|||
</blockquote>
|
||||
<p>Now, whenever a new commit lands in <code>master</code>, CircleCI will run your suite of tests and, if everything passes, your website will be deployed via the <code>publish-gh-pages</code> script.</p>
|
||||
<blockquote>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the Circle CI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the CircleCI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
</blockquote>
|
||||
<h3><a class="anchor" aria-hidden="true" id="tips-tricks"></a><a href="#tips-tricks" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Tips & Tricks</h3>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using Circle CI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> 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:</p>
|
||||
<pre><code class="hljs css language-yml"><span class="hljs-comment"># Circle CI 2.0 Config File</span>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using CircleCI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> branch fail to run successfully due to a lack of tests. You can easily work around this by creating a basic CircleCI config with the following contents:</p>
|
||||
<pre><code class="hljs css language-yml"><span class="hljs-comment"># CircleCI 2.0 Config File</span>
|
||||
<span class="hljs-comment"># This config file will prevent tests from being run on the gh-pages branch.</span>
|
||||
<span class="hljs-attr">version:</span> <span class="hljs-number">2</span>
|
||||
<span class="hljs-attr">jobs:</span>
|
||||
|
@ -235,7 +235,7 @@
|
|||
<li>Click <strong>Deploy site</strong></li>
|
||||
</ol>
|
||||
<p>You can also configure Netlify to rebuild on every commit to your repo, or only <code>master</code> branch commits.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-4-26 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.0.14/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.0.14/blog"><span>Next</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#hosting-on-a-service">Hosting on a Service:</a></li><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circle-ci-20">Using Circle CI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.0.14/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.0.14/blog"><span>Next</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#hosting-on-a-service">Hosting on a Service:</a></li><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circleci-20">Using CircleCI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -148,14 +148,14 @@
|
|||
<p>You can run the command above any time you update the docs and wish to deploy the changes to your site. Running the script manually may be fine for sites where the documentation rarely changes and it is not too much of an inconvenience to remember to manually deploy changes.</p>
|
||||
<p>However, you can automate the publishing process with continuous integration (CI).</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="automating-deployments-using-continuous-integration"></a><a href="#automating-deployments-using-continuous-integration" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Automating Deployments Using Continuous Integration</h2>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">Circle CI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circle-ci-20"></a><a href="#using-circle-ci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using Circle CI 2.0</h3>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">CircleCI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circleci-20"></a><a href="#using-circleci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using CircleCI 2.0</h3>
|
||||
<p>If you haven't done so already, you can <a href="https://circleci.com/signup/">setup CircleCI</a> for your open source project. Afterwards, in order to enable automatic deployment of your site and documentation via CircleCI, just configure Circle to run the <code>publish-gh-pages</code> script as part of the deployment step. You can follow the steps below to get that setup.</p>
|
||||
<ol>
|
||||
<li>Ensure the GitHub account that will be set as the <code>GIT_USER</code> has <code>write</code> access to the repo that contains the documentation, by checking <code>Settings | Collaborators & teams</code> in the repo.</li>
|
||||
<li>Log into GitHub as the <code>GIT_USER</code>.</li>
|
||||
<li>Go to <a href="https://github.com/settings/tokens">https://github.com/settings/tokens</a> for the <code>GIT_USER</code> and generate a new <a href="https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/">personal access token</a>, granting it full control of private repositories through the <code>repo</code> 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.</li>
|
||||
<li>Open your Circle CI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub org/repo.</li>
|
||||
<li>Open your CircleCI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub org/repo.</li>
|
||||
<li>Create a new environment variable named <code>GITHUB_TOKEN</code>, using your newly generated access token as the value.</li>
|
||||
<li>Create a <code>.circleci</code> folder and create a <code>config.yml</code> under that folder.</li>
|
||||
<li>Copy the text below into <code>.circleci/config.yml</code>.</li>
|
||||
|
@ -203,11 +203,11 @@
|
|||
</blockquote>
|
||||
<p>Now, whenever a new commit lands in <code>master</code>, CircleCI will run your suite of tests and, if everything passes, your website will be deployed via the <code>publish-gh-pages</code> script.</p>
|
||||
<blockquote>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the Circle CI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the CircleCI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
</blockquote>
|
||||
<h3><a class="anchor" aria-hidden="true" id="tips-tricks"></a><a href="#tips-tricks" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Tips & Tricks</h3>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using Circle CI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> 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:</p>
|
||||
<pre><code class="hljs css language-yml"><span class="hljs-comment"># Circle CI 2.0 Config File</span>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using CircleCI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> branch fail to run successfully due to a lack of tests. You can easily work around this by creating a basic CircleCI config with the following contents:</p>
|
||||
<pre><code class="hljs css language-yml"><span class="hljs-comment"># CircleCI 2.0 Config File</span>
|
||||
<span class="hljs-comment"># This config file will prevent tests from being run on the gh-pages branch.</span>
|
||||
<span class="hljs-attr">version:</span> <span class="hljs-number">2</span>
|
||||
<span class="hljs-attr">jobs:</span>
|
||||
|
@ -235,7 +235,7 @@
|
|||
<li>Click <strong>Deploy site</strong></li>
|
||||
</ol>
|
||||
<p>You can also configure Netlify to rebuild on every commit to your repo, or only <code>master</code> branch commits.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-4-26 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.0.14/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.0.14/blog"><span>Next</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#hosting-on-a-service">Hosting on a Service:</a></li><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circle-ci-20">Using Circle CI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.0.14/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.0.14/blog"><span>Next</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#hosting-on-a-service">Hosting on a Service:</a></li><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circleci-20">Using CircleCI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -122,7 +122,7 @@
|
|||
<hr>
|
||||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-publish"></a><a href="#docusaurus-publish" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-publish</code></h3>
|
||||
<p>Alias: <code>publish-gh-pages</code></p>
|
||||
<p><a href="/docs/en/1.0.15/commands#docusaurus-build">Builds</a>, 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:</p>
|
||||
<p><a href="/docs/en/1.0.15/commands#docusaurus-build">Builds</a>, then deploys the static website to GitHub Pages. This command is meant to be run during the deployment step in CircleCI, and therefore expects a few environment variables to be defined:</p>
|
||||
<p>The following environment variables are generally set manually by the user in the CircleCI <code>config.yml</code> file.</p>
|
||||
<ul>
|
||||
<li><code>GIT_USER</code>: The git user to be associated with the deploy commit.</li>
|
||||
|
@ -160,7 +160,7 @@
|
|||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-write-translations"></a><a href="#docusaurus-write-translations" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-write-translations</code></h3>
|
||||
<p>Alias: <code>write-translations</code></p>
|
||||
<p>Writes the English for any strings that need to be translated into an <code>website/i18n/en.json</code> file. The script will go through every file in <code>website/pages/en</code> and through the <code>siteConfig.js</code> file and other config files to fetch English strings that will then be translated on Crowdin. See the <a href="/docs/en/1.0.15/translation">Translation guide</a> to learn more.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-4-28 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.0.15/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.0.15/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples-feature"><code>docusaurus-examples [feature]</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version-currentversion-newversion"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start-port-number"><code>docusaurus-start [--port ]</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.0.15/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.0.15/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples-feature"><code>docusaurus-examples [feature]</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version-currentversion-newversion"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start-port-number"><code>docusaurus-start [--port ]</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -122,7 +122,7 @@
|
|||
<hr>
|
||||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-publish"></a><a href="#docusaurus-publish" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-publish</code></h3>
|
||||
<p>Alias: <code>publish-gh-pages</code></p>
|
||||
<p><a href="/docs/en/1.0.15/commands#docusaurus-build">Builds</a>, 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:</p>
|
||||
<p><a href="/docs/en/1.0.15/commands#docusaurus-build">Builds</a>, then deploys the static website to GitHub Pages. This command is meant to be run during the deployment step in CircleCI, and therefore expects a few environment variables to be defined:</p>
|
||||
<p>The following environment variables are generally set manually by the user in the CircleCI <code>config.yml</code> file.</p>
|
||||
<ul>
|
||||
<li><code>GIT_USER</code>: The git user to be associated with the deploy commit.</li>
|
||||
|
@ -160,7 +160,7 @@
|
|||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-write-translations"></a><a href="#docusaurus-write-translations" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-write-translations</code></h3>
|
||||
<p>Alias: <code>write-translations</code></p>
|
||||
<p>Writes the English for any strings that need to be translated into an <code>website/i18n/en.json</code> file. The script will go through every file in <code>website/pages/en</code> and through the <code>siteConfig.js</code> file and other config files to fetch English strings that will then be translated on Crowdin. See the <a href="/docs/en/1.0.15/translation">Translation guide</a> to learn more.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-4-28 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.0.15/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.0.15/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples-feature"><code>docusaurus-examples [feature]</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version-currentversion-newversion"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start-port-number"><code>docusaurus-start [--port ]</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.0.15/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.0.15/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples-feature"><code>docusaurus-examples [feature]</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version-currentversion-newversion"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start-port-number"><code>docusaurus-start [--port ]</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -151,14 +151,14 @@
|
|||
<p>You can run the command above any time you update the docs and wish to deploy the changes to your site. Running the script manually may be fine for sites where the documentation rarely changes and it is not too much of an inconvenience to remember to manually deploy changes.</p>
|
||||
<p>However, you can automate the publishing process with continuous integration (CI).</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="automating-deployments-using-continuous-integration"></a><a href="#automating-deployments-using-continuous-integration" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Automating Deployments Using Continuous Integration</h2>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">Circle CI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circle-ci-20"></a><a href="#using-circle-ci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using Circle CI 2.0</h3>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">CircleCI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circleci-20"></a><a href="#using-circleci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using CircleCI 2.0</h3>
|
||||
<p>If you haven't done so already, you can <a href="https://circleci.com/signup/">setup CircleCI</a> for your open source project. Afterwards, in order to enable automatic deployment of your site and documentation via CircleCI, just configure Circle to run the <code>publish-gh-pages</code> script as part of the deployment step. You can follow the steps below to get that setup.</p>
|
||||
<ol>
|
||||
<li>Ensure the GitHub account that will be set as the <code>GIT_USER</code> has <code>write</code> access to the repo that contains the documentation, by checking <code>Settings | Collaborators & teams</code> in the repo.</li>
|
||||
<li>Log into GitHub as the <code>GIT_USER</code>.</li>
|
||||
<li>Go to <a href="https://github.com/settings/tokens">https://github.com/settings/tokens</a> for the <code>GIT_USER</code> and generate a new <a href="https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/">personal access token</a>, granting it full control of private repositories through the <code>repo</code> 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.</li>
|
||||
<li>Open your Circle CI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub org/repo.</li>
|
||||
<li>Open your CircleCI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub org/repo.</li>
|
||||
<li>Create a new environment variable named <code>GITHUB_TOKEN</code>, using your newly generated access token as the value.</li>
|
||||
<li>Create a <code>.circleci</code> folder and create a <code>config.yml</code> under that folder.</li>
|
||||
<li>Copy the text below into <code>.circleci/config.yml</code>.</li>
|
||||
|
@ -206,11 +206,11 @@
|
|||
</blockquote>
|
||||
<p>Now, whenever a new commit lands in <code>master</code>, CircleCI will run your suite of tests and, if everything passes, your website will be deployed via the <code>publish-gh-pages</code> script.</p>
|
||||
<blockquote>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the Circle CI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the CircleCI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
</blockquote>
|
||||
<h3><a class="anchor" aria-hidden="true" id="tips-tricks"></a><a href="#tips-tricks" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Tips & Tricks</h3>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using Circle CI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> 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:</p>
|
||||
<pre><code class="hljs css language-yaml"><span class="hljs-comment"># Circle CI 2.0 Config File</span>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using CircleCI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> branch fail to run successfully due to a lack of tests. You can easily work around this by creating a basic CircleCI config with the following contents:</p>
|
||||
<pre><code class="hljs css language-yaml"><span class="hljs-comment"># CircleCI 2.0 Config File</span>
|
||||
<span class="hljs-comment"># This config file will prevent tests from being run on the gh-pages branch.</span>
|
||||
<span class="hljs-attr">version:</span> <span class="hljs-number">2</span>
|
||||
<span class="hljs-attr">jobs:</span>
|
||||
|
@ -236,7 +236,7 @@
|
|||
<li><p>Click <strong>Deploy site</strong></p></li>
|
||||
</ol>
|
||||
<p>You can also configure Netlify to rebuild on every commit to your repo, or only <code>master</code> branch commits.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-5-3 by Matías Olivera</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.0.15/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.0.15/blog"><span>Next</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#hosting-on-a-service">Hosting on a Service:</a></li><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circle-ci-20">Using Circle CI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.0.15/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.0.15/blog"><span>Next</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#hosting-on-a-service">Hosting on a Service:</a></li><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circleci-20">Using CircleCI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -151,14 +151,14 @@
|
|||
<p>You can run the command above any time you update the docs and wish to deploy the changes to your site. Running the script manually may be fine for sites where the documentation rarely changes and it is not too much of an inconvenience to remember to manually deploy changes.</p>
|
||||
<p>However, you can automate the publishing process with continuous integration (CI).</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="automating-deployments-using-continuous-integration"></a><a href="#automating-deployments-using-continuous-integration" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Automating Deployments Using Continuous Integration</h2>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">Circle CI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circle-ci-20"></a><a href="#using-circle-ci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using Circle CI 2.0</h3>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">CircleCI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circleci-20"></a><a href="#using-circleci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using CircleCI 2.0</h3>
|
||||
<p>If you haven't done so already, you can <a href="https://circleci.com/signup/">setup CircleCI</a> for your open source project. Afterwards, in order to enable automatic deployment of your site and documentation via CircleCI, just configure Circle to run the <code>publish-gh-pages</code> script as part of the deployment step. You can follow the steps below to get that setup.</p>
|
||||
<ol>
|
||||
<li>Ensure the GitHub account that will be set as the <code>GIT_USER</code> has <code>write</code> access to the repo that contains the documentation, by checking <code>Settings | Collaborators & teams</code> in the repo.</li>
|
||||
<li>Log into GitHub as the <code>GIT_USER</code>.</li>
|
||||
<li>Go to <a href="https://github.com/settings/tokens">https://github.com/settings/tokens</a> for the <code>GIT_USER</code> and generate a new <a href="https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/">personal access token</a>, granting it full control of private repositories through the <code>repo</code> 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.</li>
|
||||
<li>Open your Circle CI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub org/repo.</li>
|
||||
<li>Open your CircleCI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub org/repo.</li>
|
||||
<li>Create a new environment variable named <code>GITHUB_TOKEN</code>, using your newly generated access token as the value.</li>
|
||||
<li>Create a <code>.circleci</code> folder and create a <code>config.yml</code> under that folder.</li>
|
||||
<li>Copy the text below into <code>.circleci/config.yml</code>.</li>
|
||||
|
@ -206,11 +206,11 @@
|
|||
</blockquote>
|
||||
<p>Now, whenever a new commit lands in <code>master</code>, CircleCI will run your suite of tests and, if everything passes, your website will be deployed via the <code>publish-gh-pages</code> script.</p>
|
||||
<blockquote>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the Circle CI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the CircleCI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
</blockquote>
|
||||
<h3><a class="anchor" aria-hidden="true" id="tips-tricks"></a><a href="#tips-tricks" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Tips & Tricks</h3>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using Circle CI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> 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:</p>
|
||||
<pre><code class="hljs css language-yaml"><span class="hljs-comment"># Circle CI 2.0 Config File</span>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using CircleCI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> branch fail to run successfully due to a lack of tests. You can easily work around this by creating a basic CircleCI config with the following contents:</p>
|
||||
<pre><code class="hljs css language-yaml"><span class="hljs-comment"># CircleCI 2.0 Config File</span>
|
||||
<span class="hljs-comment"># This config file will prevent tests from being run on the gh-pages branch.</span>
|
||||
<span class="hljs-attr">version:</span> <span class="hljs-number">2</span>
|
||||
<span class="hljs-attr">jobs:</span>
|
||||
|
@ -236,7 +236,7 @@
|
|||
<li><p>Click <strong>Deploy site</strong></p></li>
|
||||
</ol>
|
||||
<p>You can also configure Netlify to rebuild on every commit to your repo, or only <code>master</code> branch commits.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-5-3 by Matías Olivera</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.0.15/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.0.15/blog"><span>Next</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#hosting-on-a-service">Hosting on a Service:</a></li><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circle-ci-20">Using Circle CI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.0.15/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.0.15/blog"><span>Next</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#hosting-on-a-service">Hosting on a Service:</a></li><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circleci-20">Using CircleCI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -141,7 +141,7 @@
|
|||
<hr>
|
||||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-publish"></a><a href="#docusaurus-publish" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-publish</code></h3>
|
||||
<p>Alias: <code>publish-gh-pages</code></p>
|
||||
<p><a href="/docs/en/1.1.0/commands#docusaurus-build">Builds</a>, 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:</p>
|
||||
<p><a href="/docs/en/1.1.0/commands#docusaurus-build">Builds</a>, then deploys the static website to GitHub Pages. This command is meant to be run during the deployment step in CircleCI, and therefore expects a few environment variables to be defined:</p>
|
||||
<p>The following environment variables are generally set manually by the user in the CircleCI <code>config.yml</code> file.</p>
|
||||
<ul>
|
||||
<li><code>GIT_USER</code>: The git user to be associated with the deploy commit.</li>
|
||||
|
@ -199,7 +199,7 @@
|
|||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-write-translations"></a><a href="#docusaurus-write-translations" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-write-translations</code></h3>
|
||||
<p>Alias: <code>write-translations</code></p>
|
||||
<p>Writes the English for any strings that need to be translated into an <code>website/i18n/en.json</code> file. The script will go through every file in <code>website/pages/en</code> and through the <code>siteConfig.js</code> file and other config files to fetch English strings that will then be translated on Crowdin. See the <a href="/docs/en/1.1.0/translation">Translation guide</a> to learn more.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-5-11 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.1.0/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.1.0/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples"><code>docusaurus-examples</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start"><code>docusaurus-start</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.1.0/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.1.0/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples"><code>docusaurus-examples</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start"><code>docusaurus-start</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -141,7 +141,7 @@
|
|||
<hr>
|
||||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-publish"></a><a href="#docusaurus-publish" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-publish</code></h3>
|
||||
<p>Alias: <code>publish-gh-pages</code></p>
|
||||
<p><a href="/docs/en/1.1.0/commands#docusaurus-build">Builds</a>, 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:</p>
|
||||
<p><a href="/docs/en/1.1.0/commands#docusaurus-build">Builds</a>, then deploys the static website to GitHub Pages. This command is meant to be run during the deployment step in CircleCI, and therefore expects a few environment variables to be defined:</p>
|
||||
<p>The following environment variables are generally set manually by the user in the CircleCI <code>config.yml</code> file.</p>
|
||||
<ul>
|
||||
<li><code>GIT_USER</code>: The git user to be associated with the deploy commit.</li>
|
||||
|
@ -199,7 +199,7 @@
|
|||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-write-translations"></a><a href="#docusaurus-write-translations" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-write-translations</code></h3>
|
||||
<p>Alias: <code>write-translations</code></p>
|
||||
<p>Writes the English for any strings that need to be translated into an <code>website/i18n/en.json</code> file. The script will go through every file in <code>website/pages/en</code> and through the <code>siteConfig.js</code> file and other config files to fetch English strings that will then be translated on Crowdin. See the <a href="/docs/en/1.1.0/translation">Translation guide</a> to learn more.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-5-11 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.1.0/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.1.0/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples"><code>docusaurus-examples</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start"><code>docusaurus-start</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.1.0/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.1.0/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples"><code>docusaurus-examples</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start"><code>docusaurus-start</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -151,14 +151,14 @@
|
|||
<p>You can run the command above any time you update the docs and wish to deploy the changes to your site. Running the script manually may be fine for sites where the documentation rarely changes and it is not too much of an inconvenience to remember to manually deploy changes.</p>
|
||||
<p>However, you can automate the publishing process with continuous integration (CI).</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="automating-deployments-using-continuous-integration"></a><a href="#automating-deployments-using-continuous-integration" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Automating Deployments Using Continuous Integration</h2>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">Circle CI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circle-ci-20"></a><a href="#using-circle-ci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using Circle CI 2.0</h3>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">CircleCI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circleci-20"></a><a href="#using-circleci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using CircleCI 2.0</h3>
|
||||
<p>If you haven't done so already, you can <a href="https://circleci.com/signup/">setup CircleCI</a> for your open source project. Afterwards, in order to enable automatic deployment of your site and documentation via CircleCI, just configure Circle to run the <code>publish-gh-pages</code> script as part of the deployment step. You can follow the steps below to get that setup.</p>
|
||||
<ol>
|
||||
<li>Ensure the GitHub account that will be set as the <code>GIT_USER</code> has <code>write</code> access to the repo that contains the documentation, by checking <code>Settings | Collaborators & teams</code> in the repo.</li>
|
||||
<li>Log into GitHub as the <code>GIT_USER</code>.</li>
|
||||
<li>Go to <a href="https://github.com/settings/tokens">https://github.com/settings/tokens</a> for the <code>GIT_USER</code> and generate a new <a href="https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/">personal access token</a>, granting it full control of private repositories through the <code>repo</code> 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.</li>
|
||||
<li>Open your Circle CI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub org/repo.</li>
|
||||
<li>Open your CircleCI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub org/repo.</li>
|
||||
<li>Create a new environment variable named <code>GITHUB_TOKEN</code>, using your newly generated access token as the value.</li>
|
||||
<li>Create a <code>.circleci</code> folder and create a <code>config.yml</code> under that folder.</li>
|
||||
<li>Copy the text below into <code>.circleci/config.yml</code>.</li>
|
||||
|
@ -206,11 +206,11 @@
|
|||
</blockquote>
|
||||
<p>Now, whenever a new commit lands in <code>master</code>, CircleCI will run your suite of tests and, if everything passes, your website will be deployed via the <code>publish-gh-pages</code> script.</p>
|
||||
<blockquote>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the Circle CI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the CircleCI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
</blockquote>
|
||||
<h3><a class="anchor" aria-hidden="true" id="tips-tricks"></a><a href="#tips-tricks" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Tips & Tricks</h3>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using Circle CI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> 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:</p>
|
||||
<pre><code class="hljs css language-yaml"><span class="hljs-comment"># Circle CI 2.0 Config File</span>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using CircleCI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> branch fail to run successfully due to a lack of tests. You can easily work around this by creating a basic CircleCI config with the following contents:</p>
|
||||
<pre><code class="hljs css language-yaml"><span class="hljs-comment"># CircleCI 2.0 Config File</span>
|
||||
<span class="hljs-comment"># This config file will prevent tests from being run on the gh-pages branch.</span>
|
||||
<span class="hljs-attr">version:</span> <span class="hljs-number">2</span>
|
||||
<span class="hljs-attr">jobs:</span>
|
||||
|
@ -236,7 +236,7 @@
|
|||
<li><p>Click <strong>Deploy site</strong></p></li>
|
||||
</ol>
|
||||
<p>You can also configure Netlify to rebuild on every commit to your repo, or only <code>master</code> branch commits.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-5-16 by Endilie Yacop Sucipto</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.1.0/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.1.0/blog"><span>Next</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#hosting-on-a-service">Hosting on a Service:</a></li><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circle-ci-20">Using Circle CI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.1.0/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.1.0/blog"><span>Next</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#hosting-on-a-service">Hosting on a Service:</a></li><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circleci-20">Using CircleCI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -151,14 +151,14 @@
|
|||
<p>You can run the command above any time you update the docs and wish to deploy the changes to your site. Running the script manually may be fine for sites where the documentation rarely changes and it is not too much of an inconvenience to remember to manually deploy changes.</p>
|
||||
<p>However, you can automate the publishing process with continuous integration (CI).</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="automating-deployments-using-continuous-integration"></a><a href="#automating-deployments-using-continuous-integration" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Automating Deployments Using Continuous Integration</h2>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">Circle CI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circle-ci-20"></a><a href="#using-circle-ci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using Circle CI 2.0</h3>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">CircleCI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circleci-20"></a><a href="#using-circleci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using CircleCI 2.0</h3>
|
||||
<p>If you haven't done so already, you can <a href="https://circleci.com/signup/">setup CircleCI</a> for your open source project. Afterwards, in order to enable automatic deployment of your site and documentation via CircleCI, just configure Circle to run the <code>publish-gh-pages</code> script as part of the deployment step. You can follow the steps below to get that setup.</p>
|
||||
<ol>
|
||||
<li>Ensure the GitHub account that will be set as the <code>GIT_USER</code> has <code>write</code> access to the repo that contains the documentation, by checking <code>Settings | Collaborators & teams</code> in the repo.</li>
|
||||
<li>Log into GitHub as the <code>GIT_USER</code>.</li>
|
||||
<li>Go to <a href="https://github.com/settings/tokens">https://github.com/settings/tokens</a> for the <code>GIT_USER</code> and generate a new <a href="https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/">personal access token</a>, granting it full control of private repositories through the <code>repo</code> 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.</li>
|
||||
<li>Open your Circle CI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub org/repo.</li>
|
||||
<li>Open your CircleCI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub org/repo.</li>
|
||||
<li>Create a new environment variable named <code>GITHUB_TOKEN</code>, using your newly generated access token as the value.</li>
|
||||
<li>Create a <code>.circleci</code> folder and create a <code>config.yml</code> under that folder.</li>
|
||||
<li>Copy the text below into <code>.circleci/config.yml</code>.</li>
|
||||
|
@ -206,11 +206,11 @@
|
|||
</blockquote>
|
||||
<p>Now, whenever a new commit lands in <code>master</code>, CircleCI will run your suite of tests and, if everything passes, your website will be deployed via the <code>publish-gh-pages</code> script.</p>
|
||||
<blockquote>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the Circle CI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the CircleCI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
</blockquote>
|
||||
<h3><a class="anchor" aria-hidden="true" id="tips-tricks"></a><a href="#tips-tricks" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Tips & Tricks</h3>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using Circle CI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> 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:</p>
|
||||
<pre><code class="hljs css language-yaml"><span class="hljs-comment"># Circle CI 2.0 Config File</span>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using CircleCI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> branch fail to run successfully due to a lack of tests. You can easily work around this by creating a basic CircleCI config with the following contents:</p>
|
||||
<pre><code class="hljs css language-yaml"><span class="hljs-comment"># CircleCI 2.0 Config File</span>
|
||||
<span class="hljs-comment"># This config file will prevent tests from being run on the gh-pages branch.</span>
|
||||
<span class="hljs-attr">version:</span> <span class="hljs-number">2</span>
|
||||
<span class="hljs-attr">jobs:</span>
|
||||
|
@ -236,7 +236,7 @@
|
|||
<li><p>Click <strong>Deploy site</strong></p></li>
|
||||
</ol>
|
||||
<p>You can also configure Netlify to rebuild on every commit to your repo, or only <code>master</code> branch commits.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-5-16 by Endilie Yacop Sucipto</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.1.0/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.1.0/blog"><span>Next</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#hosting-on-a-service">Hosting on a Service:</a></li><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circle-ci-20">Using Circle CI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.1.0/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.1.0/blog"><span>Next</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#hosting-on-a-service">Hosting on a Service:</a></li><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circleci-20">Using CircleCI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -141,7 +141,7 @@
|
|||
<hr>
|
||||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-publish"></a><a href="#docusaurus-publish" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-publish</code></h3>
|
||||
<p>Alias: <code>publish-gh-pages</code></p>
|
||||
<p><a href="/docs/en/1.1.1/commands#docusaurus-build">Builds</a>, 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:</p>
|
||||
<p><a href="/docs/en/1.1.1/commands#docusaurus-build">Builds</a>, then deploys the static website to GitHub Pages. This command is meant to be run during the deployment step in CircleCI, and therefore expects a few environment variables to be defined:</p>
|
||||
<p>The following environment variables are generally set manually by the user in the CircleCI <code>config.yml</code> file.</p>
|
||||
<ul>
|
||||
<li><code>GIT_USER</code>: The git user to be associated with the deploy commit.</li>
|
||||
|
@ -199,7 +199,7 @@
|
|||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-write-translations"></a><a href="#docusaurus-write-translations" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-write-translations</code></h3>
|
||||
<p>Alias: <code>write-translations</code></p>
|
||||
<p>Writes the English for any strings that need to be translated into an <code>website/i18n/en.json</code> file. The script will go through every file in <code>website/pages/en</code> and through the <code>siteConfig.js</code> file and other config files to fetch English strings that will then be translated on Crowdin. See the <a href="/docs/en/1.1.1/translation">Translation guide</a> to learn more.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-5-11 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.1.1/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.1.1/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples"><code>docusaurus-examples</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start"><code>docusaurus-start</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.1.1/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.1.1/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples"><code>docusaurus-examples</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start"><code>docusaurus-start</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -141,7 +141,7 @@
|
|||
<hr>
|
||||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-publish"></a><a href="#docusaurus-publish" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-publish</code></h3>
|
||||
<p>Alias: <code>publish-gh-pages</code></p>
|
||||
<p><a href="/docs/en/1.1.1/commands#docusaurus-build">Builds</a>, 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:</p>
|
||||
<p><a href="/docs/en/1.1.1/commands#docusaurus-build">Builds</a>, then deploys the static website to GitHub Pages. This command is meant to be run during the deployment step in CircleCI, and therefore expects a few environment variables to be defined:</p>
|
||||
<p>The following environment variables are generally set manually by the user in the CircleCI <code>config.yml</code> file.</p>
|
||||
<ul>
|
||||
<li><code>GIT_USER</code>: The git user to be associated with the deploy commit.</li>
|
||||
|
@ -199,7 +199,7 @@
|
|||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-write-translations"></a><a href="#docusaurus-write-translations" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-write-translations</code></h3>
|
||||
<p>Alias: <code>write-translations</code></p>
|
||||
<p>Writes the English for any strings that need to be translated into an <code>website/i18n/en.json</code> file. The script will go through every file in <code>website/pages/en</code> and through the <code>siteConfig.js</code> file and other config files to fetch English strings that will then be translated on Crowdin. See the <a href="/docs/en/1.1.1/translation">Translation guide</a> to learn more.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-5-11 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.1.1/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.1.1/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples"><code>docusaurus-examples</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start"><code>docusaurus-start</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.1.1/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.1.1/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples"><code>docusaurus-examples</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start"><code>docusaurus-start</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -151,14 +151,14 @@
|
|||
<p>You can run the command above any time you update the docs and wish to deploy the changes to your site. Running the script manually may be fine for sites where the documentation rarely changes and it is not too much of an inconvenience to remember to manually deploy changes.</p>
|
||||
<p>However, you can automate the publishing process with continuous integration (CI).</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="automating-deployments-using-continuous-integration"></a><a href="#automating-deployments-using-continuous-integration" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Automating Deployments Using Continuous Integration</h2>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">Circle CI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circle-ci-20"></a><a href="#using-circle-ci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using Circle CI 2.0</h3>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">CircleCI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circleci-20"></a><a href="#using-circleci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using CircleCI 2.0</h3>
|
||||
<p>If you haven't done so already, you can <a href="https://circleci.com/signup/">setup CircleCI</a> for your open source project. Afterwards, in order to enable automatic deployment of your site and documentation via CircleCI, just configure Circle to run the <code>publish-gh-pages</code> script as part of the deployment step. You can follow the steps below to get that setup.</p>
|
||||
<ol>
|
||||
<li>Ensure the GitHub account that will be set as the <code>GIT_USER</code> has <code>write</code> access to the repo that contains the documentation, by checking <code>Settings | Collaborators & teams</code> in the repo.</li>
|
||||
<li>Log into GitHub as the <code>GIT_USER</code>.</li>
|
||||
<li>Go to <a href="https://github.com/settings/tokens">https://github.com/settings/tokens</a> for the <code>GIT_USER</code> and generate a new <a href="https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/">personal access token</a>, granting it full control of private repositories through the <code>repo</code> 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.</li>
|
||||
<li>Open your Circle CI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub org/repo.</li>
|
||||
<li>Open your CircleCI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub org/repo.</li>
|
||||
<li>Create a new environment variable named <code>GITHUB_TOKEN</code>, using your newly generated access token as the value.</li>
|
||||
<li>Create a <code>.circleci</code> folder and create a <code>config.yml</code> under that folder.</li>
|
||||
<li>Copy the text below into <code>.circleci/config.yml</code>.</li>
|
||||
|
@ -206,11 +206,11 @@
|
|||
</blockquote>
|
||||
<p>Now, whenever a new commit lands in <code>master</code>, CircleCI will run your suite of tests and, if everything passes, your website will be deployed via the <code>publish-gh-pages</code> script.</p>
|
||||
<blockquote>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the Circle CI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the CircleCI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
</blockquote>
|
||||
<h3><a class="anchor" aria-hidden="true" id="tips-tricks"></a><a href="#tips-tricks" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Tips & Tricks</h3>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using Circle CI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> 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:</p>
|
||||
<pre><code class="hljs css language-yaml"><span class="hljs-comment"># Circle CI 2.0 Config File</span>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using CircleCI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> branch fail to run successfully due to a lack of tests. You can easily work around this by creating a basic CircleCI config with the following contents:</p>
|
||||
<pre><code class="hljs css language-yaml"><span class="hljs-comment"># CircleCI 2.0 Config File</span>
|
||||
<span class="hljs-comment"># This config file will prevent tests from being run on the gh-pages branch.</span>
|
||||
<span class="hljs-attr">version:</span> <span class="hljs-number">2</span>
|
||||
<span class="hljs-attr">jobs:</span>
|
||||
|
@ -236,7 +236,7 @@
|
|||
<li><p>Click <strong>Deploy site</strong></p></li>
|
||||
</ol>
|
||||
<p>You can also configure Netlify to rebuild on every commit to your repo, or only <code>master</code> branch commits.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-5-16 by Endilie Yacop Sucipto</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.1.1/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.1.1/blog"><span>Next</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#hosting-on-a-service">Hosting on a Service:</a></li><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circle-ci-20">Using Circle CI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.1.1/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.1.1/blog"><span>Next</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#hosting-on-a-service">Hosting on a Service:</a></li><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circleci-20">Using CircleCI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -151,14 +151,14 @@
|
|||
<p>You can run the command above any time you update the docs and wish to deploy the changes to your site. Running the script manually may be fine for sites where the documentation rarely changes and it is not too much of an inconvenience to remember to manually deploy changes.</p>
|
||||
<p>However, you can automate the publishing process with continuous integration (CI).</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="automating-deployments-using-continuous-integration"></a><a href="#automating-deployments-using-continuous-integration" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Automating Deployments Using Continuous Integration</h2>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">Circle CI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circle-ci-20"></a><a href="#using-circle-ci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using Circle CI 2.0</h3>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">CircleCI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circleci-20"></a><a href="#using-circleci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using CircleCI 2.0</h3>
|
||||
<p>If you haven't done so already, you can <a href="https://circleci.com/signup/">setup CircleCI</a> for your open source project. Afterwards, in order to enable automatic deployment of your site and documentation via CircleCI, just configure Circle to run the <code>publish-gh-pages</code> script as part of the deployment step. You can follow the steps below to get that setup.</p>
|
||||
<ol>
|
||||
<li>Ensure the GitHub account that will be set as the <code>GIT_USER</code> has <code>write</code> access to the repo that contains the documentation, by checking <code>Settings | Collaborators & teams</code> in the repo.</li>
|
||||
<li>Log into GitHub as the <code>GIT_USER</code>.</li>
|
||||
<li>Go to <a href="https://github.com/settings/tokens">https://github.com/settings/tokens</a> for the <code>GIT_USER</code> and generate a new <a href="https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/">personal access token</a>, granting it full control of private repositories through the <code>repo</code> 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.</li>
|
||||
<li>Open your Circle CI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub org/repo.</li>
|
||||
<li>Open your CircleCI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub org/repo.</li>
|
||||
<li>Create a new environment variable named <code>GITHUB_TOKEN</code>, using your newly generated access token as the value.</li>
|
||||
<li>Create a <code>.circleci</code> folder and create a <code>config.yml</code> under that folder.</li>
|
||||
<li>Copy the text below into <code>.circleci/config.yml</code>.</li>
|
||||
|
@ -206,11 +206,11 @@
|
|||
</blockquote>
|
||||
<p>Now, whenever a new commit lands in <code>master</code>, CircleCI will run your suite of tests and, if everything passes, your website will be deployed via the <code>publish-gh-pages</code> script.</p>
|
||||
<blockquote>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the Circle CI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the CircleCI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
</blockquote>
|
||||
<h3><a class="anchor" aria-hidden="true" id="tips-tricks"></a><a href="#tips-tricks" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Tips & Tricks</h3>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using Circle CI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> 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:</p>
|
||||
<pre><code class="hljs css language-yaml"><span class="hljs-comment"># Circle CI 2.0 Config File</span>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using CircleCI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> branch fail to run successfully due to a lack of tests. You can easily work around this by creating a basic CircleCI config with the following contents:</p>
|
||||
<pre><code class="hljs css language-yaml"><span class="hljs-comment"># CircleCI 2.0 Config File</span>
|
||||
<span class="hljs-comment"># This config file will prevent tests from being run on the gh-pages branch.</span>
|
||||
<span class="hljs-attr">version:</span> <span class="hljs-number">2</span>
|
||||
<span class="hljs-attr">jobs:</span>
|
||||
|
@ -236,7 +236,7 @@
|
|||
<li><p>Click <strong>Deploy site</strong></p></li>
|
||||
</ol>
|
||||
<p>You can also configure Netlify to rebuild on every commit to your repo, or only <code>master</code> branch commits.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-5-16 by Endilie Yacop Sucipto</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.1.1/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.1.1/blog"><span>Next</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#hosting-on-a-service">Hosting on a Service:</a></li><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circle-ci-20">Using Circle CI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.1.1/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.1.1/blog"><span>Next</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#hosting-on-a-service">Hosting on a Service:</a></li><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circleci-20">Using CircleCI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -141,7 +141,7 @@
|
|||
<hr>
|
||||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-publish"></a><a href="#docusaurus-publish" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-publish</code></h3>
|
||||
<p>Alias: <code>publish-gh-pages</code></p>
|
||||
<p><a href="/docs/en/1.1.2/commands#docusaurus-build">Builds</a>, 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:</p>
|
||||
<p><a href="/docs/en/1.1.2/commands#docusaurus-build">Builds</a>, then deploys the static website to GitHub Pages. This command is meant to be run during the deployment step in CircleCI, and therefore expects a few environment variables to be defined:</p>
|
||||
<p>The following environment variables are generally set manually by the user in the CircleCI <code>config.yml</code> file.</p>
|
||||
<ul>
|
||||
<li><code>GIT_USER</code>: The git user to be associated with the deploy commit.</li>
|
||||
|
@ -199,7 +199,7 @@
|
|||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-write-translations"></a><a href="#docusaurus-write-translations" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-write-translations</code></h3>
|
||||
<p>Alias: <code>write-translations</code></p>
|
||||
<p>Writes the English for any strings that need to be translated into an <code>website/i18n/en.json</code> file. The script will go through every file in <code>website/pages/en</code> and through the <code>siteConfig.js</code> file and other config files to fetch English strings that will then be translated on Crowdin. See the <a href="/docs/en/1.1.2/translation">Translation guide</a> to learn more.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-5-11 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.1.2/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.1.2/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples"><code>docusaurus-examples</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start"><code>docusaurus-start</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.1.2/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.1.2/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples"><code>docusaurus-examples</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start"><code>docusaurus-start</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -141,7 +141,7 @@
|
|||
<hr>
|
||||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-publish"></a><a href="#docusaurus-publish" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-publish</code></h3>
|
||||
<p>Alias: <code>publish-gh-pages</code></p>
|
||||
<p><a href="/docs/en/1.1.2/commands#docusaurus-build">Builds</a>, 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:</p>
|
||||
<p><a href="/docs/en/1.1.2/commands#docusaurus-build">Builds</a>, then deploys the static website to GitHub Pages. This command is meant to be run during the deployment step in CircleCI, and therefore expects a few environment variables to be defined:</p>
|
||||
<p>The following environment variables are generally set manually by the user in the CircleCI <code>config.yml</code> file.</p>
|
||||
<ul>
|
||||
<li><code>GIT_USER</code>: The git user to be associated with the deploy commit.</li>
|
||||
|
@ -199,7 +199,7 @@
|
|||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-write-translations"></a><a href="#docusaurus-write-translations" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-write-translations</code></h3>
|
||||
<p>Alias: <code>write-translations</code></p>
|
||||
<p>Writes the English for any strings that need to be translated into an <code>website/i18n/en.json</code> file. The script will go through every file in <code>website/pages/en</code> and through the <code>siteConfig.js</code> file and other config files to fetch English strings that will then be translated on Crowdin. See the <a href="/docs/en/1.1.2/translation">Translation guide</a> to learn more.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-5-11 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.1.2/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.1.2/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples"><code>docusaurus-examples</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start"><code>docusaurus-start</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.1.2/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.1.2/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples"><code>docusaurus-examples</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start"><code>docusaurus-start</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -151,14 +151,14 @@
|
|||
<p>You can run the command above any time you update the docs and wish to deploy the changes to your site. Running the script manually may be fine for sites where the documentation rarely changes and it is not too much of an inconvenience to remember to manually deploy changes.</p>
|
||||
<p>However, you can automate the publishing process with continuous integration (CI).</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="automating-deployments-using-continuous-integration"></a><a href="#automating-deployments-using-continuous-integration" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Automating Deployments Using Continuous Integration</h2>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">Circle CI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circle-ci-20"></a><a href="#using-circle-ci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using Circle CI 2.0</h3>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">CircleCI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circleci-20"></a><a href="#using-circleci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using CircleCI 2.0</h3>
|
||||
<p>If you haven't done so already, you can <a href="https://circleci.com/signup/">setup CircleCI</a> for your open source project. Afterwards, in order to enable automatic deployment of your site and documentation via CircleCI, just configure Circle to run the <code>publish-gh-pages</code> script as part of the deployment step. You can follow the steps below to get that setup.</p>
|
||||
<ol>
|
||||
<li>Ensure the GitHub account that will be set as the <code>GIT_USER</code> has <code>write</code> access to the repo that contains the documentation, by checking <code>Settings | Collaborators & teams</code> in the repo.</li>
|
||||
<li>Log into GitHub as the <code>GIT_USER</code>.</li>
|
||||
<li>Go to <a href="https://github.com/settings/tokens">https://github.com/settings/tokens</a> for the <code>GIT_USER</code> and generate a new <a href="https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/">personal access token</a>, granting it full control of private repositories through the <code>repo</code> 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.</li>
|
||||
<li>Open your Circle CI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub org/repo.</li>
|
||||
<li>Open your CircleCI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub org/repo.</li>
|
||||
<li>Create a new environment variable named <code>GITHUB_TOKEN</code>, using your newly generated access token as the value.</li>
|
||||
<li>Create a <code>.circleci</code> folder and create a <code>config.yml</code> under that folder.</li>
|
||||
<li>Copy the text below into <code>.circleci/config.yml</code>.</li>
|
||||
|
@ -206,11 +206,11 @@
|
|||
</blockquote>
|
||||
<p>Now, whenever a new commit lands in <code>master</code>, CircleCI will run your suite of tests and, if everything passes, your website will be deployed via the <code>publish-gh-pages</code> script.</p>
|
||||
<blockquote>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the Circle CI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the CircleCI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
</blockquote>
|
||||
<h3><a class="anchor" aria-hidden="true" id="tips-tricks"></a><a href="#tips-tricks" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Tips & Tricks</h3>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using Circle CI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> 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:</p>
|
||||
<pre><code class="hljs css language-yaml"><span class="hljs-comment"># Circle CI 2.0 Config File</span>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using CircleCI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> branch fail to run successfully due to a lack of tests. You can easily work around this by creating a basic CircleCI config with the following contents:</p>
|
||||
<pre><code class="hljs css language-yaml"><span class="hljs-comment"># CircleCI 2.0 Config File</span>
|
||||
<span class="hljs-comment"># This config file will prevent tests from being run on the gh-pages branch.</span>
|
||||
<span class="hljs-attr">version:</span> <span class="hljs-number">2</span>
|
||||
<span class="hljs-attr">jobs:</span>
|
||||
|
@ -236,7 +236,7 @@
|
|||
<li><p>Click <strong>Deploy site</strong></p></li>
|
||||
</ol>
|
||||
<p>You can also configure Netlify to rebuild on every commit to your repo, or only <code>master</code> branch commits.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-5-16 by Endilie Yacop Sucipto</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.1.2/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.1.2/blog"><span>Next</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#hosting-on-a-service">Hosting on a Service:</a></li><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circle-ci-20">Using Circle CI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.1.2/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.1.2/blog"><span>Next</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#hosting-on-a-service">Hosting on a Service:</a></li><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circleci-20">Using CircleCI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -151,14 +151,14 @@
|
|||
<p>You can run the command above any time you update the docs and wish to deploy the changes to your site. Running the script manually may be fine for sites where the documentation rarely changes and it is not too much of an inconvenience to remember to manually deploy changes.</p>
|
||||
<p>However, you can automate the publishing process with continuous integration (CI).</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="automating-deployments-using-continuous-integration"></a><a href="#automating-deployments-using-continuous-integration" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Automating Deployments Using Continuous Integration</h2>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">Circle CI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circle-ci-20"></a><a href="#using-circle-ci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using Circle CI 2.0</h3>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">CircleCI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circleci-20"></a><a href="#using-circleci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using CircleCI 2.0</h3>
|
||||
<p>If you haven't done so already, you can <a href="https://circleci.com/signup/">setup CircleCI</a> for your open source project. Afterwards, in order to enable automatic deployment of your site and documentation via CircleCI, just configure Circle to run the <code>publish-gh-pages</code> script as part of the deployment step. You can follow the steps below to get that setup.</p>
|
||||
<ol>
|
||||
<li>Ensure the GitHub account that will be set as the <code>GIT_USER</code> has <code>write</code> access to the repo that contains the documentation, by checking <code>Settings | Collaborators & teams</code> in the repo.</li>
|
||||
<li>Log into GitHub as the <code>GIT_USER</code>.</li>
|
||||
<li>Go to <a href="https://github.com/settings/tokens">https://github.com/settings/tokens</a> for the <code>GIT_USER</code> and generate a new <a href="https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/">personal access token</a>, granting it full control of private repositories through the <code>repo</code> 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.</li>
|
||||
<li>Open your Circle CI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub org/repo.</li>
|
||||
<li>Open your CircleCI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub org/repo.</li>
|
||||
<li>Create a new environment variable named <code>GITHUB_TOKEN</code>, using your newly generated access token as the value.</li>
|
||||
<li>Create a <code>.circleci</code> folder and create a <code>config.yml</code> under that folder.</li>
|
||||
<li>Copy the text below into <code>.circleci/config.yml</code>.</li>
|
||||
|
@ -206,11 +206,11 @@
|
|||
</blockquote>
|
||||
<p>Now, whenever a new commit lands in <code>master</code>, CircleCI will run your suite of tests and, if everything passes, your website will be deployed via the <code>publish-gh-pages</code> script.</p>
|
||||
<blockquote>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the Circle CI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the CircleCI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
</blockquote>
|
||||
<h3><a class="anchor" aria-hidden="true" id="tips-tricks"></a><a href="#tips-tricks" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Tips & Tricks</h3>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using Circle CI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> 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:</p>
|
||||
<pre><code class="hljs css language-yaml"><span class="hljs-comment"># Circle CI 2.0 Config File</span>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using CircleCI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> branch fail to run successfully due to a lack of tests. You can easily work around this by creating a basic CircleCI config with the following contents:</p>
|
||||
<pre><code class="hljs css language-yaml"><span class="hljs-comment"># CircleCI 2.0 Config File</span>
|
||||
<span class="hljs-comment"># This config file will prevent tests from being run on the gh-pages branch.</span>
|
||||
<span class="hljs-attr">version:</span> <span class="hljs-number">2</span>
|
||||
<span class="hljs-attr">jobs:</span>
|
||||
|
@ -236,7 +236,7 @@
|
|||
<li><p>Click <strong>Deploy site</strong></p></li>
|
||||
</ol>
|
||||
<p>You can also configure Netlify to rebuild on every commit to your repo, or only <code>master</code> branch commits.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-5-16 by Endilie Yacop Sucipto</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.1.2/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.1.2/blog"><span>Next</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#hosting-on-a-service">Hosting on a Service:</a></li><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circle-ci-20">Using Circle CI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.1.2/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.1.2/blog"><span>Next</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#hosting-on-a-service">Hosting on a Service:</a></li><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circleci-20">Using CircleCI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -141,7 +141,7 @@
|
|||
<hr>
|
||||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-publish"></a><a href="#docusaurus-publish" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-publish</code></h3>
|
||||
<p>Alias: <code>publish-gh-pages</code></p>
|
||||
<p><a href="/docs/en/1.1.3/commands#docusaurus-build">Builds</a>, 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:</p>
|
||||
<p><a href="/docs/en/1.1.3/commands#docusaurus-build">Builds</a>, then deploys the static website to GitHub Pages. This command is meant to be run during the deployment step in CircleCI, and therefore expects a few environment variables to be defined:</p>
|
||||
<p>The following environment variables are generally set manually by the user in the CircleCI <code>config.yml</code> file.</p>
|
||||
<ul>
|
||||
<li><code>GIT_USER</code>: The git user to be associated with the deploy commit.</li>
|
||||
|
@ -199,7 +199,7 @@
|
|||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-write-translations"></a><a href="#docusaurus-write-translations" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-write-translations</code></h3>
|
||||
<p>Alias: <code>write-translations</code></p>
|
||||
<p>Writes the English for any strings that need to be translated into an <code>website/i18n/en.json</code> file. The script will go through every file in <code>website/pages/en</code> and through the <code>siteConfig.js</code> file and other config files to fetch English strings that will then be translated on Crowdin. See the <a href="/docs/en/1.1.3/translation">Translation guide</a> to learn more.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-5-11 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.1.3/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.1.3/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples"><code>docusaurus-examples</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start"><code>docusaurus-start</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.1.3/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.1.3/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples"><code>docusaurus-examples</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start"><code>docusaurus-start</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -141,7 +141,7 @@
|
|||
<hr>
|
||||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-publish"></a><a href="#docusaurus-publish" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-publish</code></h3>
|
||||
<p>Alias: <code>publish-gh-pages</code></p>
|
||||
<p><a href="/docs/en/1.1.3/commands#docusaurus-build">Builds</a>, 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:</p>
|
||||
<p><a href="/docs/en/1.1.3/commands#docusaurus-build">Builds</a>, then deploys the static website to GitHub Pages. This command is meant to be run during the deployment step in CircleCI, and therefore expects a few environment variables to be defined:</p>
|
||||
<p>The following environment variables are generally set manually by the user in the CircleCI <code>config.yml</code> file.</p>
|
||||
<ul>
|
||||
<li><code>GIT_USER</code>: The git user to be associated with the deploy commit.</li>
|
||||
|
@ -199,7 +199,7 @@
|
|||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-write-translations"></a><a href="#docusaurus-write-translations" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-write-translations</code></h3>
|
||||
<p>Alias: <code>write-translations</code></p>
|
||||
<p>Writes the English for any strings that need to be translated into an <code>website/i18n/en.json</code> file. The script will go through every file in <code>website/pages/en</code> and through the <code>siteConfig.js</code> file and other config files to fetch English strings that will then be translated on Crowdin. See the <a href="/docs/en/1.1.3/translation">Translation guide</a> to learn more.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-5-11 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.1.3/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.1.3/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples"><code>docusaurus-examples</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start"><code>docusaurus-start</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.1.3/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.1.3/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples"><code>docusaurus-examples</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start"><code>docusaurus-start</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -151,14 +151,14 @@
|
|||
<p>You can run the command above any time you update the docs and wish to deploy the changes to your site. Running the script manually may be fine for sites where the documentation rarely changes and it is not too much of an inconvenience to remember to manually deploy changes.</p>
|
||||
<p>However, you can automate the publishing process with continuous integration (CI).</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="automating-deployments-using-continuous-integration"></a><a href="#automating-deployments-using-continuous-integration" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Automating Deployments Using Continuous Integration</h2>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">Circle CI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circle-ci-20"></a><a href="#using-circle-ci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using Circle CI 2.0</h3>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">CircleCI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circleci-20"></a><a href="#using-circleci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using CircleCI 2.0</h3>
|
||||
<p>If you haven't done so already, you can <a href="https://circleci.com/signup/">setup CircleCI</a> for your open source project. Afterwards, in order to enable automatic deployment of your site and documentation via CircleCI, just configure Circle to run the <code>publish-gh-pages</code> script as part of the deployment step. You can follow the steps below to get that setup.</p>
|
||||
<ol>
|
||||
<li>Ensure the GitHub account that will be set as the <code>GIT_USER</code> has <code>write</code> access to the repo that contains the documentation, by checking <code>Settings | Collaborators & teams</code> in the repo.</li>
|
||||
<li>Log into GitHub as the <code>GIT_USER</code>.</li>
|
||||
<li>Go to <a href="https://github.com/settings/tokens">https://github.com/settings/tokens</a> for the <code>GIT_USER</code> and generate a new <a href="https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/">personal access token</a>, granting it full control of private repositories through the <code>repo</code> 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.</li>
|
||||
<li>Open your Circle CI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub org/repo.</li>
|
||||
<li>Open your CircleCI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub org/repo.</li>
|
||||
<li>Create a new environment variable named <code>GITHUB_TOKEN</code>, using your newly generated access token as the value.</li>
|
||||
<li>Create a <code>.circleci</code> folder and create a <code>config.yml</code> under that folder.</li>
|
||||
<li>Copy the text below into <code>.circleci/config.yml</code>.</li>
|
||||
|
@ -206,11 +206,11 @@
|
|||
</blockquote>
|
||||
<p>Now, whenever a new commit lands in <code>master</code>, CircleCI will run your suite of tests and, if everything passes, your website will be deployed via the <code>publish-gh-pages</code> script.</p>
|
||||
<blockquote>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the Circle CI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the CircleCI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
</blockquote>
|
||||
<h3><a class="anchor" aria-hidden="true" id="tips-tricks"></a><a href="#tips-tricks" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Tips & Tricks</h3>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using Circle CI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> 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:</p>
|
||||
<pre><code class="hljs css language-yaml"><span class="hljs-comment"># Circle CI 2.0 Config File</span>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using CircleCI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> branch fail to run successfully due to a lack of tests. You can easily work around this by creating a basic CircleCI config with the following contents:</p>
|
||||
<pre><code class="hljs css language-yaml"><span class="hljs-comment"># CircleCI 2.0 Config File</span>
|
||||
<span class="hljs-comment"># This config file will prevent tests from being run on the gh-pages branch.</span>
|
||||
<span class="hljs-attr">version:</span> <span class="hljs-number">2</span>
|
||||
<span class="hljs-attr">jobs:</span>
|
||||
|
@ -236,7 +236,7 @@
|
|||
<li><p>Click <strong>Deploy site</strong></p></li>
|
||||
</ol>
|
||||
<p>You can also configure Netlify to rebuild on every commit to your repo, or only <code>master</code> branch commits.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-5-16 by Endilie Yacop Sucipto</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.1.3/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.1.3/blog"><span>Next</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#hosting-on-a-service">Hosting on a Service:</a></li><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circle-ci-20">Using Circle CI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.1.3/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.1.3/blog"><span>Next</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#hosting-on-a-service">Hosting on a Service:</a></li><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circleci-20">Using CircleCI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -151,14 +151,14 @@
|
|||
<p>You can run the command above any time you update the docs and wish to deploy the changes to your site. Running the script manually may be fine for sites where the documentation rarely changes and it is not too much of an inconvenience to remember to manually deploy changes.</p>
|
||||
<p>However, you can automate the publishing process with continuous integration (CI).</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="automating-deployments-using-continuous-integration"></a><a href="#automating-deployments-using-continuous-integration" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Automating Deployments Using Continuous Integration</h2>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">Circle CI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circle-ci-20"></a><a href="#using-circle-ci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using Circle CI 2.0</h3>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">CircleCI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circleci-20"></a><a href="#using-circleci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using CircleCI 2.0</h3>
|
||||
<p>If you haven't done so already, you can <a href="https://circleci.com/signup/">setup CircleCI</a> for your open source project. Afterwards, in order to enable automatic deployment of your site and documentation via CircleCI, just configure Circle to run the <code>publish-gh-pages</code> script as part of the deployment step. You can follow the steps below to get that setup.</p>
|
||||
<ol>
|
||||
<li>Ensure the GitHub account that will be set as the <code>GIT_USER</code> has <code>write</code> access to the repo that contains the documentation, by checking <code>Settings | Collaborators & teams</code> in the repo.</li>
|
||||
<li>Log into GitHub as the <code>GIT_USER</code>.</li>
|
||||
<li>Go to <a href="https://github.com/settings/tokens">https://github.com/settings/tokens</a> for the <code>GIT_USER</code> and generate a new <a href="https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/">personal access token</a>, granting it full control of private repositories through the <code>repo</code> 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.</li>
|
||||
<li>Open your Circle CI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub org/repo.</li>
|
||||
<li>Open your CircleCI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub org/repo.</li>
|
||||
<li>Create a new environment variable named <code>GITHUB_TOKEN</code>, using your newly generated access token as the value.</li>
|
||||
<li>Create a <code>.circleci</code> folder and create a <code>config.yml</code> under that folder.</li>
|
||||
<li>Copy the text below into <code>.circleci/config.yml</code>.</li>
|
||||
|
@ -206,11 +206,11 @@
|
|||
</blockquote>
|
||||
<p>Now, whenever a new commit lands in <code>master</code>, CircleCI will run your suite of tests and, if everything passes, your website will be deployed via the <code>publish-gh-pages</code> script.</p>
|
||||
<blockquote>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the Circle CI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the CircleCI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
</blockquote>
|
||||
<h3><a class="anchor" aria-hidden="true" id="tips-tricks"></a><a href="#tips-tricks" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Tips & Tricks</h3>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using Circle CI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> 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:</p>
|
||||
<pre><code class="hljs css language-yaml"><span class="hljs-comment"># Circle CI 2.0 Config File</span>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using CircleCI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> branch fail to run successfully due to a lack of tests. You can easily work around this by creating a basic CircleCI config with the following contents:</p>
|
||||
<pre><code class="hljs css language-yaml"><span class="hljs-comment"># CircleCI 2.0 Config File</span>
|
||||
<span class="hljs-comment"># This config file will prevent tests from being run on the gh-pages branch.</span>
|
||||
<span class="hljs-attr">version:</span> <span class="hljs-number">2</span>
|
||||
<span class="hljs-attr">jobs:</span>
|
||||
|
@ -236,7 +236,7 @@
|
|||
<li><p>Click <strong>Deploy site</strong></p></li>
|
||||
</ol>
|
||||
<p>You can also configure Netlify to rebuild on every commit to your repo, or only <code>master</code> branch commits.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-5-16 by Endilie Yacop Sucipto</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.1.3/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.1.3/blog"><span>Next</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#hosting-on-a-service">Hosting on a Service:</a></li><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circle-ci-20">Using Circle CI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.1.3/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.1.3/blog"><span>Next</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#hosting-on-a-service">Hosting on a Service:</a></li><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circleci-20">Using CircleCI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -141,7 +141,7 @@
|
|||
<hr>
|
||||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-publish"></a><a href="#docusaurus-publish" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-publish</code></h3>
|
||||
<p>Alias: <code>publish-gh-pages</code></p>
|
||||
<p><a href="/docs/en/1.1.4/commands#docusaurus-build">Builds</a>, 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:</p>
|
||||
<p><a href="/docs/en/1.1.4/commands#docusaurus-build">Builds</a>, then deploys the static website to GitHub Pages. This command is meant to be run during the deployment step in CircleCI, and therefore expects a few environment variables to be defined:</p>
|
||||
<p>The following environment variables are generally set manually by the user in the CircleCI <code>config.yml</code> file.</p>
|
||||
<ul>
|
||||
<li><code>GIT_USER</code>: The git user to be associated with the deploy commit.</li>
|
||||
|
@ -199,7 +199,7 @@
|
|||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-write-translations"></a><a href="#docusaurus-write-translations" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-write-translations</code></h3>
|
||||
<p>Alias: <code>write-translations</code></p>
|
||||
<p>Writes the English for any strings that need to be translated into an <code>website/i18n/en.json</code> file. The script will go through every file in <code>website/pages/en</code> and through the <code>siteConfig.js</code> file and other config files to fetch English strings that will then be translated on Crowdin. See the <a href="/docs/en/1.1.4/translation">Translation guide</a> to learn more.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-5-11 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.1.4/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.1.4/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples"><code>docusaurus-examples</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start"><code>docusaurus-start</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.1.4/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.1.4/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples"><code>docusaurus-examples</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start"><code>docusaurus-start</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -141,7 +141,7 @@
|
|||
<hr>
|
||||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-publish"></a><a href="#docusaurus-publish" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-publish</code></h3>
|
||||
<p>Alias: <code>publish-gh-pages</code></p>
|
||||
<p><a href="/docs/en/1.1.4/commands#docusaurus-build">Builds</a>, 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:</p>
|
||||
<p><a href="/docs/en/1.1.4/commands#docusaurus-build">Builds</a>, then deploys the static website to GitHub Pages. This command is meant to be run during the deployment step in CircleCI, and therefore expects a few environment variables to be defined:</p>
|
||||
<p>The following environment variables are generally set manually by the user in the CircleCI <code>config.yml</code> file.</p>
|
||||
<ul>
|
||||
<li><code>GIT_USER</code>: The git user to be associated with the deploy commit.</li>
|
||||
|
@ -199,7 +199,7 @@
|
|||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-write-translations"></a><a href="#docusaurus-write-translations" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-write-translations</code></h3>
|
||||
<p>Alias: <code>write-translations</code></p>
|
||||
<p>Writes the English for any strings that need to be translated into an <code>website/i18n/en.json</code> file. The script will go through every file in <code>website/pages/en</code> and through the <code>siteConfig.js</code> file and other config files to fetch English strings that will then be translated on Crowdin. See the <a href="/docs/en/1.1.4/translation">Translation guide</a> to learn more.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-5-11 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.1.4/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.1.4/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples"><code>docusaurus-examples</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start"><code>docusaurus-start</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.1.4/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.1.4/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples"><code>docusaurus-examples</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start"><code>docusaurus-start</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -151,14 +151,14 @@
|
|||
<p>You can run the command above any time you update the docs and wish to deploy the changes to your site. Running the script manually may be fine for sites where the documentation rarely changes and it is not too much of an inconvenience to remember to manually deploy changes.</p>
|
||||
<p>However, you can automate the publishing process with continuous integration (CI).</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="automating-deployments-using-continuous-integration"></a><a href="#automating-deployments-using-continuous-integration" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Automating Deployments Using Continuous Integration</h2>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">Circle CI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circle-ci-20"></a><a href="#using-circle-ci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using Circle CI 2.0</h3>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">CircleCI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circleci-20"></a><a href="#using-circleci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using CircleCI 2.0</h3>
|
||||
<p>If you haven't done so already, you can <a href="https://circleci.com/signup/">setup CircleCI</a> for your open source project. Afterwards, in order to enable automatic deployment of your site and documentation via CircleCI, just configure Circle to run the <code>publish-gh-pages</code> script as part of the deployment step. You can follow the steps below to get that setup.</p>
|
||||
<ol>
|
||||
<li>Ensure the GitHub account that will be set as the <code>GIT_USER</code> has <code>write</code> access to the repo that contains the documentation, by checking <code>Settings | Collaborators & teams</code> in the repo.</li>
|
||||
<li>Log into GitHub as the <code>GIT_USER</code>.</li>
|
||||
<li>Go to <a href="https://github.com/settings/tokens">https://github.com/settings/tokens</a> for the <code>GIT_USER</code> and generate a new <a href="https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/">personal access token</a>, granting it full control of private repositories through the <code>repo</code> 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.</li>
|
||||
<li>Open your Circle CI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub org/repo.</li>
|
||||
<li>Open your CircleCI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub org/repo.</li>
|
||||
<li>Create a new environment variable named <code>GITHUB_TOKEN</code>, using your newly generated access token as the value.</li>
|
||||
<li>Create a <code>.circleci</code> folder and create a <code>config.yml</code> under that folder.</li>
|
||||
<li>Copy the text below into <code>.circleci/config.yml</code>.</li>
|
||||
|
@ -206,11 +206,11 @@
|
|||
</blockquote>
|
||||
<p>Now, whenever a new commit lands in <code>master</code>, CircleCI will run your suite of tests and, if everything passes, your website will be deployed via the <code>publish-gh-pages</code> script.</p>
|
||||
<blockquote>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the Circle CI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the CircleCI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
</blockquote>
|
||||
<h3><a class="anchor" aria-hidden="true" id="tips-tricks"></a><a href="#tips-tricks" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Tips & Tricks</h3>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using Circle CI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> 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:</p>
|
||||
<pre><code class="hljs css language-yaml"><span class="hljs-comment"># Circle CI 2.0 Config File</span>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using CircleCI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> branch fail to run successfully due to a lack of tests. You can easily work around this by creating a basic CircleCI config with the following contents:</p>
|
||||
<pre><code class="hljs css language-yaml"><span class="hljs-comment"># CircleCI 2.0 Config File</span>
|
||||
<span class="hljs-comment"># This config file will prevent tests from being run on the gh-pages branch.</span>
|
||||
<span class="hljs-attr">version:</span> <span class="hljs-number">2</span>
|
||||
<span class="hljs-attr">jobs:</span>
|
||||
|
@ -236,7 +236,7 @@
|
|||
<li><p>Click <strong>Deploy site</strong></p></li>
|
||||
</ol>
|
||||
<p>You can also configure Netlify to rebuild on every commit to your repo, or only <code>master</code> branch commits.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-5-16 by Endilie Yacop Sucipto</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.1.4/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.1.4/blog"><span>Next</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#hosting-on-a-service">Hosting on a Service:</a></li><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circle-ci-20">Using Circle CI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.1.4/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.1.4/blog"><span>Next</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#hosting-on-a-service">Hosting on a Service:</a></li><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circleci-20">Using CircleCI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -151,14 +151,14 @@
|
|||
<p>You can run the command above any time you update the docs and wish to deploy the changes to your site. Running the script manually may be fine for sites where the documentation rarely changes and it is not too much of an inconvenience to remember to manually deploy changes.</p>
|
||||
<p>However, you can automate the publishing process with continuous integration (CI).</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="automating-deployments-using-continuous-integration"></a><a href="#automating-deployments-using-continuous-integration" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Automating Deployments Using Continuous Integration</h2>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">Circle CI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circle-ci-20"></a><a href="#using-circle-ci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using Circle CI 2.0</h3>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">CircleCI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circleci-20"></a><a href="#using-circleci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using CircleCI 2.0</h3>
|
||||
<p>If you haven't done so already, you can <a href="https://circleci.com/signup/">setup CircleCI</a> for your open source project. Afterwards, in order to enable automatic deployment of your site and documentation via CircleCI, just configure Circle to run the <code>publish-gh-pages</code> script as part of the deployment step. You can follow the steps below to get that setup.</p>
|
||||
<ol>
|
||||
<li>Ensure the GitHub account that will be set as the <code>GIT_USER</code> has <code>write</code> access to the repo that contains the documentation, by checking <code>Settings | Collaborators & teams</code> in the repo.</li>
|
||||
<li>Log into GitHub as the <code>GIT_USER</code>.</li>
|
||||
<li>Go to <a href="https://github.com/settings/tokens">https://github.com/settings/tokens</a> for the <code>GIT_USER</code> and generate a new <a href="https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/">personal access token</a>, granting it full control of private repositories through the <code>repo</code> 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.</li>
|
||||
<li>Open your Circle CI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub org/repo.</li>
|
||||
<li>Open your CircleCI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub org/repo.</li>
|
||||
<li>Create a new environment variable named <code>GITHUB_TOKEN</code>, using your newly generated access token as the value.</li>
|
||||
<li>Create a <code>.circleci</code> folder and create a <code>config.yml</code> under that folder.</li>
|
||||
<li>Copy the text below into <code>.circleci/config.yml</code>.</li>
|
||||
|
@ -206,11 +206,11 @@
|
|||
</blockquote>
|
||||
<p>Now, whenever a new commit lands in <code>master</code>, CircleCI will run your suite of tests and, if everything passes, your website will be deployed via the <code>publish-gh-pages</code> script.</p>
|
||||
<blockquote>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the Circle CI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the CircleCI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
</blockquote>
|
||||
<h3><a class="anchor" aria-hidden="true" id="tips-tricks"></a><a href="#tips-tricks" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Tips & Tricks</h3>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using Circle CI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> 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:</p>
|
||||
<pre><code class="hljs css language-yaml"><span class="hljs-comment"># Circle CI 2.0 Config File</span>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using CircleCI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> branch fail to run successfully due to a lack of tests. You can easily work around this by creating a basic CircleCI config with the following contents:</p>
|
||||
<pre><code class="hljs css language-yaml"><span class="hljs-comment"># CircleCI 2.0 Config File</span>
|
||||
<span class="hljs-comment"># This config file will prevent tests from being run on the gh-pages branch.</span>
|
||||
<span class="hljs-attr">version:</span> <span class="hljs-number">2</span>
|
||||
<span class="hljs-attr">jobs:</span>
|
||||
|
@ -236,7 +236,7 @@
|
|||
<li><p>Click <strong>Deploy site</strong></p></li>
|
||||
</ol>
|
||||
<p>You can also configure Netlify to rebuild on every commit to your repo, or only <code>master</code> branch commits.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-5-16 by Endilie Yacop Sucipto</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.1.4/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.1.4/blog"><span>Next</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#hosting-on-a-service">Hosting on a Service:</a></li><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circle-ci-20">Using Circle CI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.1.4/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.1.4/blog"><span>Next</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#hosting-on-a-service">Hosting on a Service:</a></li><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circleci-20">Using CircleCI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -141,7 +141,7 @@
|
|||
<hr>
|
||||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-publish"></a><a href="#docusaurus-publish" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-publish</code></h3>
|
||||
<p>Alias: <code>publish-gh-pages</code></p>
|
||||
<p><a href="/docs/en/1.1.5/commands#docusaurus-build">Builds</a>, 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:</p>
|
||||
<p><a href="/docs/en/1.1.5/commands#docusaurus-build">Builds</a>, then deploys the static website to GitHub Pages. This command is meant to be run during the deployment step in CircleCI, and therefore expects a few environment variables to be defined:</p>
|
||||
<p>The following environment variables are generally set manually by the user in the CircleCI <code>config.yml</code> file.</p>
|
||||
<ul>
|
||||
<li><code>GIT_USER</code>: The git user to be associated with the deploy commit.</li>
|
||||
|
@ -199,7 +199,7 @@
|
|||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-write-translations"></a><a href="#docusaurus-write-translations" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-write-translations</code></h3>
|
||||
<p>Alias: <code>write-translations</code></p>
|
||||
<p>Writes the English for any strings that need to be translated into an <code>website/i18n/en.json</code> file. The script will go through every file in <code>website/pages/en</code> and through the <code>siteConfig.js</code> file and other config files to fetch English strings that will then be translated on Crowdin. See the <a href="/docs/en/1.1.5/translation">Translation guide</a> to learn more.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-5-11 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.1.5/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.1.5/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples"><code>docusaurus-examples</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start"><code>docusaurus-start</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.1.5/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.1.5/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples"><code>docusaurus-examples</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start"><code>docusaurus-start</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -141,7 +141,7 @@
|
|||
<hr>
|
||||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-publish"></a><a href="#docusaurus-publish" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-publish</code></h3>
|
||||
<p>Alias: <code>publish-gh-pages</code></p>
|
||||
<p><a href="/docs/en/1.1.5/commands#docusaurus-build">Builds</a>, 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:</p>
|
||||
<p><a href="/docs/en/1.1.5/commands#docusaurus-build">Builds</a>, then deploys the static website to GitHub Pages. This command is meant to be run during the deployment step in CircleCI, and therefore expects a few environment variables to be defined:</p>
|
||||
<p>The following environment variables are generally set manually by the user in the CircleCI <code>config.yml</code> file.</p>
|
||||
<ul>
|
||||
<li><code>GIT_USER</code>: The git user to be associated with the deploy commit.</li>
|
||||
|
@ -199,7 +199,7 @@
|
|||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-write-translations"></a><a href="#docusaurus-write-translations" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-write-translations</code></h3>
|
||||
<p>Alias: <code>write-translations</code></p>
|
||||
<p>Writes the English for any strings that need to be translated into an <code>website/i18n/en.json</code> file. The script will go through every file in <code>website/pages/en</code> and through the <code>siteConfig.js</code> file and other config files to fetch English strings that will then be translated on Crowdin. See the <a href="/docs/en/1.1.5/translation">Translation guide</a> to learn more.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-5-11 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.1.5/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.1.5/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples"><code>docusaurus-examples</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start"><code>docusaurus-start</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.1.5/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.1.5/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples"><code>docusaurus-examples</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start"><code>docusaurus-start</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -151,14 +151,14 @@
|
|||
<p>You can run the command above any time you update the docs and wish to deploy the changes to your site. Running the script manually may be fine for sites where the documentation rarely changes and it is not too much of an inconvenience to remember to manually deploy changes.</p>
|
||||
<p>However, you can automate the publishing process with continuous integration (CI).</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="automating-deployments-using-continuous-integration"></a><a href="#automating-deployments-using-continuous-integration" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Automating Deployments Using Continuous Integration</h2>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">Circle CI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circle-ci-20"></a><a href="#using-circle-ci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using Circle CI 2.0</h3>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">CircleCI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circleci-20"></a><a href="#using-circleci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using CircleCI 2.0</h3>
|
||||
<p>If you haven't done so already, you can <a href="https://circleci.com/signup/">setup CircleCI</a> for your open source project. Afterwards, in order to enable automatic deployment of your site and documentation via CircleCI, just configure Circle to run the <code>publish-gh-pages</code> script as part of the deployment step. You can follow the steps below to get that setup.</p>
|
||||
<ol>
|
||||
<li>Ensure the GitHub account that will be set as the <code>GIT_USER</code> has <code>write</code> access to the repo that contains the documentation, by checking <code>Settings | Collaborators & teams</code> in the repo.</li>
|
||||
<li>Log into GitHub as the <code>GIT_USER</code>.</li>
|
||||
<li>Go to <a href="https://github.com/settings/tokens">https://github.com/settings/tokens</a> for the <code>GIT_USER</code> and generate a new <a href="https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/">personal access token</a>, granting it full control of private repositories through the <code>repo</code> 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.</li>
|
||||
<li>Open your Circle CI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub org/repo.</li>
|
||||
<li>Open your CircleCI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub org/repo.</li>
|
||||
<li>Create a new environment variable named <code>GITHUB_TOKEN</code>, using your newly generated access token as the value.</li>
|
||||
<li>Create a <code>.circleci</code> folder and create a <code>config.yml</code> under that folder.</li>
|
||||
<li>Copy the text below into <code>.circleci/config.yml</code>.</li>
|
||||
|
@ -206,11 +206,11 @@
|
|||
</blockquote>
|
||||
<p>Now, whenever a new commit lands in <code>master</code>, CircleCI will run your suite of tests and, if everything passes, your website will be deployed via the <code>publish-gh-pages</code> script.</p>
|
||||
<blockquote>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the Circle CI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the CircleCI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
</blockquote>
|
||||
<h3><a class="anchor" aria-hidden="true" id="tips-tricks"></a><a href="#tips-tricks" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Tips & Tricks</h3>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using Circle CI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> 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:</p>
|
||||
<pre><code class="hljs css language-yaml"><span class="hljs-comment"># Circle CI 2.0 Config File</span>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using CircleCI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> branch fail to run successfully due to a lack of tests. You can easily work around this by creating a basic CircleCI config with the following contents:</p>
|
||||
<pre><code class="hljs css language-yaml"><span class="hljs-comment"># CircleCI 2.0 Config File</span>
|
||||
<span class="hljs-comment"># This config file will prevent tests from being run on the gh-pages branch.</span>
|
||||
<span class="hljs-attr">version:</span> <span class="hljs-number">2</span>
|
||||
<span class="hljs-attr">jobs:</span>
|
||||
|
@ -236,7 +236,7 @@
|
|||
<li><p>Click <strong>Deploy site</strong></p></li>
|
||||
</ol>
|
||||
<p>You can also configure Netlify to rebuild on every commit to your repo, or only <code>master</code> branch commits.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-5-16 by Endilie Yacop Sucipto</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.1.5/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.1.5/blog"><span>Next</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#hosting-on-a-service">Hosting on a Service:</a></li><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circle-ci-20">Using Circle CI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.1.5/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.1.5/blog"><span>Next</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#hosting-on-a-service">Hosting on a Service:</a></li><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circleci-20">Using CircleCI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -151,14 +151,14 @@
|
|||
<p>You can run the command above any time you update the docs and wish to deploy the changes to your site. Running the script manually may be fine for sites where the documentation rarely changes and it is not too much of an inconvenience to remember to manually deploy changes.</p>
|
||||
<p>However, you can automate the publishing process with continuous integration (CI).</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="automating-deployments-using-continuous-integration"></a><a href="#automating-deployments-using-continuous-integration" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Automating Deployments Using Continuous Integration</h2>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">Circle CI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circle-ci-20"></a><a href="#using-circle-ci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using Circle CI 2.0</h3>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">CircleCI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circleci-20"></a><a href="#using-circleci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using CircleCI 2.0</h3>
|
||||
<p>If you haven't done so already, you can <a href="https://circleci.com/signup/">setup CircleCI</a> for your open source project. Afterwards, in order to enable automatic deployment of your site and documentation via CircleCI, just configure Circle to run the <code>publish-gh-pages</code> script as part of the deployment step. You can follow the steps below to get that setup.</p>
|
||||
<ol>
|
||||
<li>Ensure the GitHub account that will be set as the <code>GIT_USER</code> has <code>write</code> access to the repo that contains the documentation, by checking <code>Settings | Collaborators & teams</code> in the repo.</li>
|
||||
<li>Log into GitHub as the <code>GIT_USER</code>.</li>
|
||||
<li>Go to <a href="https://github.com/settings/tokens">https://github.com/settings/tokens</a> for the <code>GIT_USER</code> and generate a new <a href="https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/">personal access token</a>, granting it full control of private repositories through the <code>repo</code> 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.</li>
|
||||
<li>Open your Circle CI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub org/repo.</li>
|
||||
<li>Open your CircleCI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub org/repo.</li>
|
||||
<li>Create a new environment variable named <code>GITHUB_TOKEN</code>, using your newly generated access token as the value.</li>
|
||||
<li>Create a <code>.circleci</code> folder and create a <code>config.yml</code> under that folder.</li>
|
||||
<li>Copy the text below into <code>.circleci/config.yml</code>.</li>
|
||||
|
@ -206,11 +206,11 @@
|
|||
</blockquote>
|
||||
<p>Now, whenever a new commit lands in <code>master</code>, CircleCI will run your suite of tests and, if everything passes, your website will be deployed via the <code>publish-gh-pages</code> script.</p>
|
||||
<blockquote>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the Circle CI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the CircleCI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
</blockquote>
|
||||
<h3><a class="anchor" aria-hidden="true" id="tips-tricks"></a><a href="#tips-tricks" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Tips & Tricks</h3>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using Circle CI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> 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:</p>
|
||||
<pre><code class="hljs css language-yaml"><span class="hljs-comment"># Circle CI 2.0 Config File</span>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using CircleCI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> branch fail to run successfully due to a lack of tests. You can easily work around this by creating a basic CircleCI config with the following contents:</p>
|
||||
<pre><code class="hljs css language-yaml"><span class="hljs-comment"># CircleCI 2.0 Config File</span>
|
||||
<span class="hljs-comment"># This config file will prevent tests from being run on the gh-pages branch.</span>
|
||||
<span class="hljs-attr">version:</span> <span class="hljs-number">2</span>
|
||||
<span class="hljs-attr">jobs:</span>
|
||||
|
@ -236,7 +236,7 @@
|
|||
<li><p>Click <strong>Deploy site</strong></p></li>
|
||||
</ol>
|
||||
<p>You can also configure Netlify to rebuild on every commit to your repo, or only <code>master</code> branch commits.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-5-16 by Endilie Yacop Sucipto</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.1.5/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.1.5/blog"><span>Next</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#hosting-on-a-service">Hosting on a Service:</a></li><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circle-ci-20">Using Circle CI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.1.5/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.1.5/blog"><span>Next</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#hosting-on-a-service">Hosting on a Service:</a></li><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circleci-20">Using CircleCI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -141,7 +141,7 @@
|
|||
<hr>
|
||||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-publish"></a><a href="#docusaurus-publish" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-publish</code></h3>
|
||||
<p>Alias: <code>publish-gh-pages</code></p>
|
||||
<p><a href="/docs/en/1.2.0/commands#docusaurus-build">Builds</a>, 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:</p>
|
||||
<p><a href="/docs/en/1.2.0/commands#docusaurus-build">Builds</a>, then deploys the static website to GitHub Pages. This command is meant to be run during the deployment step in CircleCI, and therefore expects a few environment variables to be defined:</p>
|
||||
<p>The following environment variables are generally set manually by the user in the CircleCI <code>config.yml</code> file.</p>
|
||||
<ul>
|
||||
<li><code>GIT_USER</code>: The git user to be associated with the deploy commit.</li>
|
||||
|
@ -199,7 +199,7 @@
|
|||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-write-translations"></a><a href="#docusaurus-write-translations" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-write-translations</code></h3>
|
||||
<p>Alias: <code>write-translations</code></p>
|
||||
<p>Writes the English for any strings that need to be translated into an <code>website/i18n/en.json</code> file. The script will go through every file in <code>website/pages/en</code> and through the <code>siteConfig.js</code> file and other config files to fetch English strings that will then be translated on Crowdin. See the <a href="/docs/en/1.2.0/translation">Translation guide</a> to learn more.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-6-10 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.2.0/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.2.0/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples"><code>docusaurus-examples</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start"><code>docusaurus-start</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.2.0/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.2.0/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples"><code>docusaurus-examples</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start"><code>docusaurus-start</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -141,7 +141,7 @@
|
|||
<hr>
|
||||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-publish"></a><a href="#docusaurus-publish" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-publish</code></h3>
|
||||
<p>Alias: <code>publish-gh-pages</code></p>
|
||||
<p><a href="/docs/en/1.2.0/commands#docusaurus-build">Builds</a>, 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:</p>
|
||||
<p><a href="/docs/en/1.2.0/commands#docusaurus-build">Builds</a>, then deploys the static website to GitHub Pages. This command is meant to be run during the deployment step in CircleCI, and therefore expects a few environment variables to be defined:</p>
|
||||
<p>The following environment variables are generally set manually by the user in the CircleCI <code>config.yml</code> file.</p>
|
||||
<ul>
|
||||
<li><code>GIT_USER</code>: The git user to be associated with the deploy commit.</li>
|
||||
|
@ -199,7 +199,7 @@
|
|||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-write-translations"></a><a href="#docusaurus-write-translations" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-write-translations</code></h3>
|
||||
<p>Alias: <code>write-translations</code></p>
|
||||
<p>Writes the English for any strings that need to be translated into an <code>website/i18n/en.json</code> file. The script will go through every file in <code>website/pages/en</code> and through the <code>siteConfig.js</code> file and other config files to fetch English strings that will then be translated on Crowdin. See the <a href="/docs/en/1.2.0/translation">Translation guide</a> to learn more.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-6-10 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.2.0/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.2.0/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples"><code>docusaurus-examples</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start"><code>docusaurus-start</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.2.0/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.2.0/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples"><code>docusaurus-examples</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start"><code>docusaurus-start</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -151,14 +151,14 @@
|
|||
<p>You can run the command above any time you update the docs and wish to deploy the changes to your site. Running the script manually may be fine for sites where the documentation rarely changes and it is not too much of an inconvenience to remember to manually deploy changes.</p>
|
||||
<p>However, you can automate the publishing process with continuous integration (CI).</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="automating-deployments-using-continuous-integration"></a><a href="#automating-deployments-using-continuous-integration" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Automating Deployments Using Continuous Integration</h2>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">Circle CI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circle-ci-20"></a><a href="#using-circle-ci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using Circle CI 2.0</h3>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">CircleCI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circleci-20"></a><a href="#using-circleci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using CircleCI 2.0</h3>
|
||||
<p>If you haven't done so already, you can <a href="https://circleci.com/signup/">setup CircleCI</a> for your open source project. Afterwards, in order to enable automatic deployment of your site and documentation via CircleCI, just configure Circle to run the <code>publish-gh-pages</code> script as part of the deployment step. You can follow the steps below to get that setup.</p>
|
||||
<ol>
|
||||
<li>Ensure the GitHub account that will be set as the <code>GIT_USER</code> has <code>write</code> access to the repository that contains the documentation, by checking <code>Settings | Collaborators & teams</code> in the repository.</li>
|
||||
<li>Log into GitHub as the <code>GIT_USER</code>.</li>
|
||||
<li>Go to <a href="https://github.com/settings/tokens">https://github.com/settings/tokens</a> for the <code>GIT_USER</code> and generate a new <a href="https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/">personal access token</a>, granting it full control of private repositories through the <code>repository</code> 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.</li>
|
||||
<li>Open your Circle CI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub organization/repository.</li>
|
||||
<li>Open your CircleCI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub organization/repository.</li>
|
||||
<li>Create a new environment variable named <code>GITHUB_TOKEN</code>, using your newly generated access token as the value.</li>
|
||||
<li>Create a <code>.circleci</code> directory and create a <code>config.yml</code> under that directory.</li>
|
||||
<li>Copy the text below into <code>.circleci/config.yml</code>.</li>
|
||||
|
@ -206,11 +206,11 @@
|
|||
</blockquote>
|
||||
<p>Now, whenever a new commit lands in <code>master</code>, CircleCI will run your suite of tests and, if everything passes, your website will be deployed via the <code>publish-gh-pages</code> script.</p>
|
||||
<blockquote>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the Circle CI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the CircleCI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
</blockquote>
|
||||
<h3><a class="anchor" aria-hidden="true" id="tips-tricks"></a><a href="#tips-tricks" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Tips & Tricks</h3>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using Circle CI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> 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:</p>
|
||||
<pre><code class="hljs css language-yaml"><span class="hljs-comment"># Circle CI 2.0 Config File</span>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using CircleCI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> branch fail to run successfully due to a lack of tests. You can easily work around this by creating a basic CircleCI config with the following contents:</p>
|
||||
<pre><code class="hljs css language-yaml"><span class="hljs-comment"># CircleCI 2.0 Config File</span>
|
||||
<span class="hljs-comment"># This config file will prevent tests from being run on the gh-pages branch.</span>
|
||||
<span class="hljs-attr">version:</span> <span class="hljs-number">2</span>
|
||||
<span class="hljs-attr">jobs:</span>
|
||||
|
@ -271,7 +271,7 @@
|
|||
</tbody>
|
||||
</table>
|
||||
<p>Alter your <code>siteConfig.js</code> to add a property <code>'githubHost'</code> which represents the GitHub Enterprise hostname. Alternatively, set an environment variable <code>GITHUB_HOST</code> when executing the publish command.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-6-10 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.2.0/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.2.0/blog"><span>Next</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#hosting-on-a-service">Hosting on a Service:</a></li><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circle-ci-20">Using Circle CI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li><li><a href="#using-travis-ci">Using Travis CI</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li><li><a href="#publishing-to-github-enterprise">Publishing to GitHub Enterprise</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.2.0/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.2.0/blog"><span>Next</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#hosting-on-a-service">Hosting on a Service:</a></li><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circleci-20">Using CircleCI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li><li><a href="#using-travis-ci">Using Travis CI</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li><li><a href="#publishing-to-github-enterprise">Publishing to GitHub Enterprise</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -151,14 +151,14 @@
|
|||
<p>You can run the command above any time you update the docs and wish to deploy the changes to your site. Running the script manually may be fine for sites where the documentation rarely changes and it is not too much of an inconvenience to remember to manually deploy changes.</p>
|
||||
<p>However, you can automate the publishing process with continuous integration (CI).</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="automating-deployments-using-continuous-integration"></a><a href="#automating-deployments-using-continuous-integration" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Automating Deployments Using Continuous Integration</h2>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">Circle CI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circle-ci-20"></a><a href="#using-circle-ci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using Circle CI 2.0</h3>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">CircleCI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circleci-20"></a><a href="#using-circleci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using CircleCI 2.0</h3>
|
||||
<p>If you haven't done so already, you can <a href="https://circleci.com/signup/">setup CircleCI</a> for your open source project. Afterwards, in order to enable automatic deployment of your site and documentation via CircleCI, just configure Circle to run the <code>publish-gh-pages</code> script as part of the deployment step. You can follow the steps below to get that setup.</p>
|
||||
<ol>
|
||||
<li>Ensure the GitHub account that will be set as the <code>GIT_USER</code> has <code>write</code> access to the repository that contains the documentation, by checking <code>Settings | Collaborators & teams</code> in the repository.</li>
|
||||
<li>Log into GitHub as the <code>GIT_USER</code>.</li>
|
||||
<li>Go to <a href="https://github.com/settings/tokens">https://github.com/settings/tokens</a> for the <code>GIT_USER</code> and generate a new <a href="https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/">personal access token</a>, granting it full control of private repositories through the <code>repository</code> 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.</li>
|
||||
<li>Open your Circle CI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub organization/repository.</li>
|
||||
<li>Open your CircleCI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub organization/repository.</li>
|
||||
<li>Create a new environment variable named <code>GITHUB_TOKEN</code>, using your newly generated access token as the value.</li>
|
||||
<li>Create a <code>.circleci</code> directory and create a <code>config.yml</code> under that directory.</li>
|
||||
<li>Copy the text below into <code>.circleci/config.yml</code>.</li>
|
||||
|
@ -206,11 +206,11 @@
|
|||
</blockquote>
|
||||
<p>Now, whenever a new commit lands in <code>master</code>, CircleCI will run your suite of tests and, if everything passes, your website will be deployed via the <code>publish-gh-pages</code> script.</p>
|
||||
<blockquote>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the Circle CI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the CircleCI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
</blockquote>
|
||||
<h3><a class="anchor" aria-hidden="true" id="tips-tricks"></a><a href="#tips-tricks" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Tips & Tricks</h3>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using Circle CI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> 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:</p>
|
||||
<pre><code class="hljs css language-yaml"><span class="hljs-comment"># Circle CI 2.0 Config File</span>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using CircleCI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> branch fail to run successfully due to a lack of tests. You can easily work around this by creating a basic CircleCI config with the following contents:</p>
|
||||
<pre><code class="hljs css language-yaml"><span class="hljs-comment"># CircleCI 2.0 Config File</span>
|
||||
<span class="hljs-comment"># This config file will prevent tests from being run on the gh-pages branch.</span>
|
||||
<span class="hljs-attr">version:</span> <span class="hljs-number">2</span>
|
||||
<span class="hljs-attr">jobs:</span>
|
||||
|
@ -271,7 +271,7 @@
|
|||
</tbody>
|
||||
</table>
|
||||
<p>Alter your <code>siteConfig.js</code> to add a property <code>'githubHost'</code> which represents the GitHub Enterprise hostname. Alternatively, set an environment variable <code>GITHUB_HOST</code> when executing the publish command.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-6-10 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.2.0/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.2.0/blog"><span>Next</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#hosting-on-a-service">Hosting on a Service:</a></li><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circle-ci-20">Using Circle CI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li><li><a href="#using-travis-ci">Using Travis CI</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li><li><a href="#publishing-to-github-enterprise">Publishing to GitHub Enterprise</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.2.0/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.2.0/blog"><span>Next</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#hosting-on-a-service">Hosting on a Service:</a></li><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circleci-20">Using CircleCI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li><li><a href="#using-travis-ci">Using Travis CI</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li><li><a href="#publishing-to-github-enterprise">Publishing to GitHub Enterprise</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -141,7 +141,7 @@
|
|||
<hr>
|
||||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-publish"></a><a href="#docusaurus-publish" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-publish</code></h3>
|
||||
<p>Alias: <code>publish-gh-pages</code></p>
|
||||
<p><a href="/docs/en/1.2.1/commands#docusaurus-build">Builds</a>, 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:</p>
|
||||
<p><a href="/docs/en/1.2.1/commands#docusaurus-build">Builds</a>, then deploys the static website to GitHub Pages. This command is meant to be run during the deployment step in CircleCI, and therefore expects a few environment variables to be defined:</p>
|
||||
<p>The following environment variables are generally set manually by the user in the CircleCI <code>config.yml</code> file.</p>
|
||||
<ul>
|
||||
<li><code>GIT_USER</code>: The git user to be associated with the deploy commit.</li>
|
||||
|
@ -200,7 +200,7 @@
|
|||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-write-translations"></a><a href="#docusaurus-write-translations" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-write-translations</code></h3>
|
||||
<p>Alias: <code>write-translations</code></p>
|
||||
<p>Writes the English for any strings that need to be translated into an <code>website/i18n/en.json</code> file. The script will go through every file in <code>website/pages/en</code> and through the <code>siteConfig.js</code> file and other config files to fetch English strings that will then be translated on Crowdin. See the <a href="/docs/en/1.2.1/translation">Translation guide</a> to learn more.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-6-15 by =^._.^=</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.2.1/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.2.1/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples"><code>docusaurus-examples</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start"><code>docusaurus-start</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.2.1/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.2.1/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples"><code>docusaurus-examples</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start"><code>docusaurus-start</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -141,7 +141,7 @@
|
|||
<hr>
|
||||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-publish"></a><a href="#docusaurus-publish" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-publish</code></h3>
|
||||
<p>Alias: <code>publish-gh-pages</code></p>
|
||||
<p><a href="/docs/en/1.2.1/commands#docusaurus-build">Builds</a>, 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:</p>
|
||||
<p><a href="/docs/en/1.2.1/commands#docusaurus-build">Builds</a>, then deploys the static website to GitHub Pages. This command is meant to be run during the deployment step in CircleCI, and therefore expects a few environment variables to be defined:</p>
|
||||
<p>The following environment variables are generally set manually by the user in the CircleCI <code>config.yml</code> file.</p>
|
||||
<ul>
|
||||
<li><code>GIT_USER</code>: The git user to be associated with the deploy commit.</li>
|
||||
|
@ -200,7 +200,7 @@
|
|||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-write-translations"></a><a href="#docusaurus-write-translations" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-write-translations</code></h3>
|
||||
<p>Alias: <code>write-translations</code></p>
|
||||
<p>Writes the English for any strings that need to be translated into an <code>website/i18n/en.json</code> file. The script will go through every file in <code>website/pages/en</code> and through the <code>siteConfig.js</code> file and other config files to fetch English strings that will then be translated on Crowdin. See the <a href="/docs/en/1.2.1/translation">Translation guide</a> to learn more.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-6-15 by =^._.^=</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.2.1/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.2.1/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples"><code>docusaurus-examples</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start"><code>docusaurus-start</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.2.1/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.2.1/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples"><code>docusaurus-examples</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start"><code>docusaurus-start</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -113,7 +113,7 @@
|
|||
</tbody>
|
||||
</table>
|
||||
<blockquote>
|
||||
<p>Docusaurus also supports deploying <a href="https://help.github.com/articles/user-organization-and-project-pages/#user--organization-pages">user or organization sites</a>. To do this, just set <code>projectName</code> to "<em>username</em>.github.io" (where <em>username</em> is your username or organization name on GitHub) and <code>organizationName</code> to "<em>username</em>".<br>
|
||||
<p>Docusaurus also supports deploying <a href="https://help.github.com/articles/user-organization-and-project-pages/#user--organization-pages">user or organization sites</a>. To do this, just set <code>projectName</code> to "<em>username</em>.github.io" (where <em>username</em> is your username or organization name on GitHub) and <code>organizationName</code> to "<em>username</em>".
|
||||
For user or org sites, the publish script will deploy these sites to the root of the <code>master</code> branch of the <em>username</em>.github.io repo. In this case, note that you will want to have the Docusaurus infra, your docs, etc. either in another branch of the <em>username</em>.github.io repo (e.g., maybe call it <code>source</code>), or in another, separated repo (e.g. in the same as the documented source code).</p>
|
||||
</blockquote>
|
||||
<blockquote>
|
||||
|
@ -152,14 +152,14 @@ For user or org sites, the publish script will deploy these sites to the root of
|
|||
<p>You can run the command above any time you update the docs and wish to deploy the changes to your site. Running the script manually may be fine for sites where the documentation rarely changes and it is not too much of an inconvenience to remember to manually deploy changes.</p>
|
||||
<p>However, you can automate the publishing process with continuous integration (CI).</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="automating-deployments-using-continuous-integration"></a><a href="#automating-deployments-using-continuous-integration" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Automating Deployments Using Continuous Integration</h2>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">Circle CI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circle-ci-20"></a><a href="#using-circle-ci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using Circle CI 2.0</h3>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">CircleCI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circleci-20"></a><a href="#using-circleci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using CircleCI 2.0</h3>
|
||||
<p>If you haven't done so already, you can <a href="https://circleci.com/signup/">setup CircleCI</a> for your open source project. Afterwards, in order to enable automatic deployment of your site and documentation via CircleCI, just configure Circle to run the <code>publish-gh-pages</code> script as part of the deployment step. You can follow the steps below to get that setup.</p>
|
||||
<ol>
|
||||
<li>Ensure the GitHub account that will be set as the <code>GIT_USER</code> has <code>write</code> access to the repository that contains the documentation, by checking <code>Settings | Collaborators & teams</code> in the repository.</li>
|
||||
<li>Log into GitHub as the <code>GIT_USER</code>.</li>
|
||||
<li>Go to <a href="https://github.com/settings/tokens">https://github.com/settings/tokens</a> for the <code>GIT_USER</code> and generate a new <a href="https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/">personal access token</a>, granting it full control of private repositories through the <code>repository</code> 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.</li>
|
||||
<li>Open your Circle CI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub organization/repository.</li>
|
||||
<li>Open your CircleCI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub organization/repository.</li>
|
||||
<li>Create a new environment variable named <code>GITHUB_TOKEN</code>, using your newly generated access token as the value.</li>
|
||||
<li>Create a <code>.circleci</code> directory and create a <code>config.yml</code> under that directory.</li>
|
||||
<li>Copy the text below into <code>.circleci/config.yml</code>.</li>
|
||||
|
@ -207,11 +207,11 @@ For user or org sites, the publish script will deploy these sites to the root of
|
|||
</blockquote>
|
||||
<p>Now, whenever a new commit lands in <code>master</code>, CircleCI will run your suite of tests and, if everything passes, your website will be deployed via the <code>publish-gh-pages</code> script.</p>
|
||||
<blockquote>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the Circle CI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the CircleCI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
</blockquote>
|
||||
<h3><a class="anchor" aria-hidden="true" id="tips-tricks"></a><a href="#tips-tricks" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Tips & Tricks</h3>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using Circle CI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> 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:</p>
|
||||
<pre><code class="hljs css language-yaml"><span class="hljs-comment"># Circle CI 2.0 Config File</span>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using CircleCI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> branch fail to run successfully due to a lack of tests. You can easily work around this by creating a basic CircleCI config with the following contents:</p>
|
||||
<pre><code class="hljs css language-yaml"><span class="hljs-comment"># CircleCI 2.0 Config File</span>
|
||||
<span class="hljs-comment"># This config file will prevent tests from being run on the gh-pages branch.</span>
|
||||
<span class="hljs-attr">version:</span> <span class="hljs-number">2</span>
|
||||
<span class="hljs-attr">jobs:</span>
|
||||
|
@ -272,7 +272,7 @@ For user or org sites, the publish script will deploy these sites to the root of
|
|||
</tbody>
|
||||
</table>
|
||||
<p>Alter your <code>siteConfig.js</code> to add a property <code>'githubHost'</code> which represents the GitHub Enterprise hostname. Alternatively, set an environment variable <code>GITHUB_HOST</code> when executing the publish command.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-6-14 by Gustavo Henke</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.2.1/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.2.1/blog"><span>Next</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#hosting-on-a-service">Hosting on a Service:</a></li><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circle-ci-20">Using Circle CI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li><li><a href="#using-travis-ci">Using Travis CI</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li><li><a href="#publishing-to-github-enterprise">Publishing to GitHub Enterprise</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.2.1/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.2.1/blog"><span>Next</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#hosting-on-a-service">Hosting on a Service:</a></li><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circleci-20">Using CircleCI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li><li><a href="#using-travis-ci">Using Travis CI</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li><li><a href="#publishing-to-github-enterprise">Publishing to GitHub Enterprise</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -113,7 +113,7 @@
|
|||
</tbody>
|
||||
</table>
|
||||
<blockquote>
|
||||
<p>Docusaurus also supports deploying <a href="https://help.github.com/articles/user-organization-and-project-pages/#user--organization-pages">user or organization sites</a>. To do this, just set <code>projectName</code> to "<em>username</em>.github.io" (where <em>username</em> is your username or organization name on GitHub) and <code>organizationName</code> to "<em>username</em>".<br>
|
||||
<p>Docusaurus also supports deploying <a href="https://help.github.com/articles/user-organization-and-project-pages/#user--organization-pages">user or organization sites</a>. To do this, just set <code>projectName</code> to "<em>username</em>.github.io" (where <em>username</em> is your username or organization name on GitHub) and <code>organizationName</code> to "<em>username</em>".
|
||||
For user or org sites, the publish script will deploy these sites to the root of the <code>master</code> branch of the <em>username</em>.github.io repo. In this case, note that you will want to have the Docusaurus infra, your docs, etc. either in another branch of the <em>username</em>.github.io repo (e.g., maybe call it <code>source</code>), or in another, separated repo (e.g. in the same as the documented source code).</p>
|
||||
</blockquote>
|
||||
<blockquote>
|
||||
|
@ -152,14 +152,14 @@ For user or org sites, the publish script will deploy these sites to the root of
|
|||
<p>You can run the command above any time you update the docs and wish to deploy the changes to your site. Running the script manually may be fine for sites where the documentation rarely changes and it is not too much of an inconvenience to remember to manually deploy changes.</p>
|
||||
<p>However, you can automate the publishing process with continuous integration (CI).</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="automating-deployments-using-continuous-integration"></a><a href="#automating-deployments-using-continuous-integration" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Automating Deployments Using Continuous Integration</h2>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">Circle CI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circle-ci-20"></a><a href="#using-circle-ci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using Circle CI 2.0</h3>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">CircleCI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circleci-20"></a><a href="#using-circleci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using CircleCI 2.0</h3>
|
||||
<p>If you haven't done so already, you can <a href="https://circleci.com/signup/">setup CircleCI</a> for your open source project. Afterwards, in order to enable automatic deployment of your site and documentation via CircleCI, just configure Circle to run the <code>publish-gh-pages</code> script as part of the deployment step. You can follow the steps below to get that setup.</p>
|
||||
<ol>
|
||||
<li>Ensure the GitHub account that will be set as the <code>GIT_USER</code> has <code>write</code> access to the repository that contains the documentation, by checking <code>Settings | Collaborators & teams</code> in the repository.</li>
|
||||
<li>Log into GitHub as the <code>GIT_USER</code>.</li>
|
||||
<li>Go to <a href="https://github.com/settings/tokens">https://github.com/settings/tokens</a> for the <code>GIT_USER</code> and generate a new <a href="https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/">personal access token</a>, granting it full control of private repositories through the <code>repository</code> 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.</li>
|
||||
<li>Open your Circle CI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub organization/repository.</li>
|
||||
<li>Open your CircleCI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub organization/repository.</li>
|
||||
<li>Create a new environment variable named <code>GITHUB_TOKEN</code>, using your newly generated access token as the value.</li>
|
||||
<li>Create a <code>.circleci</code> directory and create a <code>config.yml</code> under that directory.</li>
|
||||
<li>Copy the text below into <code>.circleci/config.yml</code>.</li>
|
||||
|
@ -207,11 +207,11 @@ For user or org sites, the publish script will deploy these sites to the root of
|
|||
</blockquote>
|
||||
<p>Now, whenever a new commit lands in <code>master</code>, CircleCI will run your suite of tests and, if everything passes, your website will be deployed via the <code>publish-gh-pages</code> script.</p>
|
||||
<blockquote>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the Circle CI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the CircleCI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
</blockquote>
|
||||
<h3><a class="anchor" aria-hidden="true" id="tips-tricks"></a><a href="#tips-tricks" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Tips & Tricks</h3>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using Circle CI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> 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:</p>
|
||||
<pre><code class="hljs css language-yaml"><span class="hljs-comment"># Circle CI 2.0 Config File</span>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using CircleCI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> branch fail to run successfully due to a lack of tests. You can easily work around this by creating a basic CircleCI config with the following contents:</p>
|
||||
<pre><code class="hljs css language-yaml"><span class="hljs-comment"># CircleCI 2.0 Config File</span>
|
||||
<span class="hljs-comment"># This config file will prevent tests from being run on the gh-pages branch.</span>
|
||||
<span class="hljs-attr">version:</span> <span class="hljs-number">2</span>
|
||||
<span class="hljs-attr">jobs:</span>
|
||||
|
@ -272,7 +272,7 @@ For user or org sites, the publish script will deploy these sites to the root of
|
|||
</tbody>
|
||||
</table>
|
||||
<p>Alter your <code>siteConfig.js</code> to add a property <code>'githubHost'</code> which represents the GitHub Enterprise hostname. Alternatively, set an environment variable <code>GITHUB_HOST</code> when executing the publish command.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-6-14 by Gustavo Henke</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.2.1/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.2.1/blog"><span>Next</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#hosting-on-a-service">Hosting on a Service:</a></li><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circle-ci-20">Using Circle CI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li><li><a href="#using-travis-ci">Using Travis CI</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li><li><a href="#publishing-to-github-enterprise">Publishing to GitHub Enterprise</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.2.1/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.2.1/blog"><span>Next</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#hosting-on-a-service">Hosting on a Service:</a></li><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circleci-20">Using CircleCI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li><li><a href="#using-travis-ci">Using Travis CI</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li><li><a href="#publishing-to-github-enterprise">Publishing to GitHub Enterprise</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -141,7 +141,7 @@
|
|||
<hr>
|
||||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-publish"></a><a href="#docusaurus-publish" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-publish</code></h3>
|
||||
<p>Alias: <code>publish-gh-pages</code></p>
|
||||
<p><a href="/docs/en/1.3.0/commands#docusaurus-build">Builds</a>, 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:</p>
|
||||
<p><a href="/docs/en/1.3.0/commands#docusaurus-build">Builds</a>, then deploys the static website to GitHub Pages. This command is meant to be run during the deployment step in CircleCI, and therefore expects a few environment variables to be defined:</p>
|
||||
<p>The following environment variables are generally set manually by the user in the CircleCI <code>config.yml</code> file.</p>
|
||||
<ul>
|
||||
<li><code>GIT_USER</code>: The git user to be associated with the deploy commit.</li>
|
||||
|
@ -200,7 +200,7 @@
|
|||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-write-translations"></a><a href="#docusaurus-write-translations" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-write-translations</code></h3>
|
||||
<p>Alias: <code>write-translations</code></p>
|
||||
<p>Writes the English for any strings that need to be translated into an <code>website/i18n/en.json</code> file. The script will go through every file in <code>website/pages/en</code> and through the <code>siteConfig.js</code> file and other config files to fetch English strings that will then be translated on Crowdin. See the <a href="/docs/en/1.3.0/translation">Translation guide</a> to learn more.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-6-15 by =^._.^=</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.3.0/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.3.0/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples"><code>docusaurus-examples</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start"><code>docusaurus-start</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.3.0/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.3.0/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples"><code>docusaurus-examples</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start"><code>docusaurus-start</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -141,7 +141,7 @@
|
|||
<hr>
|
||||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-publish"></a><a href="#docusaurus-publish" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-publish</code></h3>
|
||||
<p>Alias: <code>publish-gh-pages</code></p>
|
||||
<p><a href="/docs/en/1.3.0/commands#docusaurus-build">Builds</a>, 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:</p>
|
||||
<p><a href="/docs/en/1.3.0/commands#docusaurus-build">Builds</a>, then deploys the static website to GitHub Pages. This command is meant to be run during the deployment step in CircleCI, and therefore expects a few environment variables to be defined:</p>
|
||||
<p>The following environment variables are generally set manually by the user in the CircleCI <code>config.yml</code> file.</p>
|
||||
<ul>
|
||||
<li><code>GIT_USER</code>: The git user to be associated with the deploy commit.</li>
|
||||
|
@ -200,7 +200,7 @@
|
|||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-write-translations"></a><a href="#docusaurus-write-translations" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-write-translations</code></h3>
|
||||
<p>Alias: <code>write-translations</code></p>
|
||||
<p>Writes the English for any strings that need to be translated into an <code>website/i18n/en.json</code> file. The script will go through every file in <code>website/pages/en</code> and through the <code>siteConfig.js</code> file and other config files to fetch English strings that will then be translated on Crowdin. See the <a href="/docs/en/1.3.0/translation">Translation guide</a> to learn more.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-6-15 by =^._.^=</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.3.0/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.3.0/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples"><code>docusaurus-examples</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start"><code>docusaurus-start</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.3.0/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.3.0/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples"><code>docusaurus-examples</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start"><code>docusaurus-start</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -113,7 +113,7 @@
|
|||
</tbody>
|
||||
</table>
|
||||
<blockquote>
|
||||
<p>Docusaurus also supports deploying <a href="https://help.github.com/articles/user-organization-and-project-pages/#user--organization-pages">user or organization sites</a>. To do this, just set <code>projectName</code> to "<em>username</em>.github.io" (where <em>username</em> is your username or organization name on GitHub) and <code>organizationName</code> to "<em>username</em>".<br>
|
||||
<p>Docusaurus also supports deploying <a href="https://help.github.com/articles/user-organization-and-project-pages/#user--organization-pages">user or organization sites</a>. To do this, just set <code>projectName</code> to "<em>username</em>.github.io" (where <em>username</em> is your username or organization name on GitHub) and <code>organizationName</code> to "<em>username</em>".
|
||||
For user or org sites, the publish script will deploy these sites to the root of the <code>master</code> branch of the <em>username</em>.github.io repo. In this case, note that you will want to have the Docusaurus infra, your docs, etc. either in another branch of the <em>username</em>.github.io repo (e.g., maybe call it <code>source</code>), or in another, separated repo (e.g. in the same as the documented source code).</p>
|
||||
</blockquote>
|
||||
<blockquote>
|
||||
|
@ -152,14 +152,14 @@ For user or org sites, the publish script will deploy these sites to the root of
|
|||
<p>You can run the command above any time you update the docs and wish to deploy the changes to your site. Running the script manually may be fine for sites where the documentation rarely changes and it is not too much of an inconvenience to remember to manually deploy changes.</p>
|
||||
<p>However, you can automate the publishing process with continuous integration (CI).</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="automating-deployments-using-continuous-integration"></a><a href="#automating-deployments-using-continuous-integration" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Automating Deployments Using Continuous Integration</h2>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">Circle CI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circle-ci-20"></a><a href="#using-circle-ci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using Circle CI 2.0</h3>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">CircleCI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circleci-20"></a><a href="#using-circleci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using CircleCI 2.0</h3>
|
||||
<p>If you haven't done so already, you can <a href="https://circleci.com/signup/">setup CircleCI</a> for your open source project. Afterwards, in order to enable automatic deployment of your site and documentation via CircleCI, just configure Circle to run the <code>publish-gh-pages</code> script as part of the deployment step. You can follow the steps below to get that setup.</p>
|
||||
<ol>
|
||||
<li>Ensure the GitHub account that will be set as the <code>GIT_USER</code> has <code>write</code> access to the repository that contains the documentation, by checking <code>Settings | Collaborators & teams</code> in the repository.</li>
|
||||
<li>Log into GitHub as the <code>GIT_USER</code>.</li>
|
||||
<li>Go to <a href="https://github.com/settings/tokens">https://github.com/settings/tokens</a> for the <code>GIT_USER</code> and generate a new <a href="https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/">personal access token</a>, granting it full control of private repositories through the <code>repository</code> 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.</li>
|
||||
<li>Open your Circle CI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub organization/repository.</li>
|
||||
<li>Open your CircleCI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub organization/repository.</li>
|
||||
<li>Create a new environment variable named <code>GITHUB_TOKEN</code>, using your newly generated access token as the value.</li>
|
||||
<li>Create a <code>.circleci</code> directory and create a <code>config.yml</code> under that directory.</li>
|
||||
<li>Copy the text below into <code>.circleci/config.yml</code>.</li>
|
||||
|
@ -207,11 +207,11 @@ For user or org sites, the publish script will deploy these sites to the root of
|
|||
</blockquote>
|
||||
<p>Now, whenever a new commit lands in <code>master</code>, CircleCI will run your suite of tests and, if everything passes, your website will be deployed via the <code>publish-gh-pages</code> script.</p>
|
||||
<blockquote>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the Circle CI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the CircleCI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
</blockquote>
|
||||
<h3><a class="anchor" aria-hidden="true" id="tips-tricks"></a><a href="#tips-tricks" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Tips & Tricks</h3>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using Circle CI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> 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:</p>
|
||||
<pre><code class="hljs css language-yaml"><span class="hljs-comment"># Circle CI 2.0 Config File</span>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using CircleCI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> branch fail to run successfully due to a lack of tests. You can easily work around this by creating a basic CircleCI config with the following contents:</p>
|
||||
<pre><code class="hljs css language-yaml"><span class="hljs-comment"># CircleCI 2.0 Config File</span>
|
||||
<span class="hljs-comment"># This config file will prevent tests from being run on the gh-pages branch.</span>
|
||||
<span class="hljs-attr">version:</span> <span class="hljs-number">2</span>
|
||||
<span class="hljs-attr">jobs:</span>
|
||||
|
@ -272,7 +272,7 @@ For user or org sites, the publish script will deploy these sites to the root of
|
|||
</tbody>
|
||||
</table>
|
||||
<p>Alter your <code>siteConfig.js</code> to add a property <code>'githubHost'</code> which represents the GitHub Enterprise hostname. Alternatively, set an environment variable <code>GITHUB_HOST</code> when executing the publish command.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-6-14 by Gustavo Henke</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.3.0/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.3.0/adding-blog"><span>Adding a Blog</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#hosting-on-a-service">Hosting on a Service:</a></li><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circle-ci-20">Using Circle CI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li><li><a href="#using-travis-ci">Using Travis CI</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li><li><a href="#publishing-to-github-enterprise">Publishing to GitHub Enterprise</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.3.0/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.3.0/adding-blog"><span>Adding a Blog</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#hosting-on-a-service">Hosting on a Service:</a></li><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circleci-20">Using CircleCI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li><li><a href="#using-travis-ci">Using Travis CI</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li><li><a href="#publishing-to-github-enterprise">Publishing to GitHub Enterprise</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -113,7 +113,7 @@
|
|||
</tbody>
|
||||
</table>
|
||||
<blockquote>
|
||||
<p>Docusaurus also supports deploying <a href="https://help.github.com/articles/user-organization-and-project-pages/#user--organization-pages">user or organization sites</a>. To do this, just set <code>projectName</code> to "<em>username</em>.github.io" (where <em>username</em> is your username or organization name on GitHub) and <code>organizationName</code> to "<em>username</em>".<br>
|
||||
<p>Docusaurus also supports deploying <a href="https://help.github.com/articles/user-organization-and-project-pages/#user--organization-pages">user or organization sites</a>. To do this, just set <code>projectName</code> to "<em>username</em>.github.io" (where <em>username</em> is your username or organization name on GitHub) and <code>organizationName</code> to "<em>username</em>".
|
||||
For user or org sites, the publish script will deploy these sites to the root of the <code>master</code> branch of the <em>username</em>.github.io repo. In this case, note that you will want to have the Docusaurus infra, your docs, etc. either in another branch of the <em>username</em>.github.io repo (e.g., maybe call it <code>source</code>), or in another, separated repo (e.g. in the same as the documented source code).</p>
|
||||
</blockquote>
|
||||
<blockquote>
|
||||
|
@ -152,14 +152,14 @@ For user or org sites, the publish script will deploy these sites to the root of
|
|||
<p>You can run the command above any time you update the docs and wish to deploy the changes to your site. Running the script manually may be fine for sites where the documentation rarely changes and it is not too much of an inconvenience to remember to manually deploy changes.</p>
|
||||
<p>However, you can automate the publishing process with continuous integration (CI).</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="automating-deployments-using-continuous-integration"></a><a href="#automating-deployments-using-continuous-integration" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Automating Deployments Using Continuous Integration</h2>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">Circle CI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circle-ci-20"></a><a href="#using-circle-ci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using Circle CI 2.0</h3>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">CircleCI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circleci-20"></a><a href="#using-circleci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using CircleCI 2.0</h3>
|
||||
<p>If you haven't done so already, you can <a href="https://circleci.com/signup/">setup CircleCI</a> for your open source project. Afterwards, in order to enable automatic deployment of your site and documentation via CircleCI, just configure Circle to run the <code>publish-gh-pages</code> script as part of the deployment step. You can follow the steps below to get that setup.</p>
|
||||
<ol>
|
||||
<li>Ensure the GitHub account that will be set as the <code>GIT_USER</code> has <code>write</code> access to the repository that contains the documentation, by checking <code>Settings | Collaborators & teams</code> in the repository.</li>
|
||||
<li>Log into GitHub as the <code>GIT_USER</code>.</li>
|
||||
<li>Go to <a href="https://github.com/settings/tokens">https://github.com/settings/tokens</a> for the <code>GIT_USER</code> and generate a new <a href="https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/">personal access token</a>, granting it full control of private repositories through the <code>repository</code> 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.</li>
|
||||
<li>Open your Circle CI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub organization/repository.</li>
|
||||
<li>Open your CircleCI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub organization/repository.</li>
|
||||
<li>Create a new environment variable named <code>GITHUB_TOKEN</code>, using your newly generated access token as the value.</li>
|
||||
<li>Create a <code>.circleci</code> directory and create a <code>config.yml</code> under that directory.</li>
|
||||
<li>Copy the text below into <code>.circleci/config.yml</code>.</li>
|
||||
|
@ -207,11 +207,11 @@ For user or org sites, the publish script will deploy these sites to the root of
|
|||
</blockquote>
|
||||
<p>Now, whenever a new commit lands in <code>master</code>, CircleCI will run your suite of tests and, if everything passes, your website will be deployed via the <code>publish-gh-pages</code> script.</p>
|
||||
<blockquote>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the Circle CI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the CircleCI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
</blockquote>
|
||||
<h3><a class="anchor" aria-hidden="true" id="tips-tricks"></a><a href="#tips-tricks" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Tips & Tricks</h3>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using Circle CI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> 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:</p>
|
||||
<pre><code class="hljs css language-yaml"><span class="hljs-comment"># Circle CI 2.0 Config File</span>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using CircleCI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> branch fail to run successfully due to a lack of tests. You can easily work around this by creating a basic CircleCI config with the following contents:</p>
|
||||
<pre><code class="hljs css language-yaml"><span class="hljs-comment"># CircleCI 2.0 Config File</span>
|
||||
<span class="hljs-comment"># This config file will prevent tests from being run on the gh-pages branch.</span>
|
||||
<span class="hljs-attr">version:</span> <span class="hljs-number">2</span>
|
||||
<span class="hljs-attr">jobs:</span>
|
||||
|
@ -272,7 +272,7 @@ For user or org sites, the publish script will deploy these sites to the root of
|
|||
</tbody>
|
||||
</table>
|
||||
<p>Alter your <code>siteConfig.js</code> to add a property <code>'githubHost'</code> which represents the GitHub Enterprise hostname. Alternatively, set an environment variable <code>GITHUB_HOST</code> when executing the publish command.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-6-14 by Gustavo Henke</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.3.0/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.3.0/adding-blog"><span>Adding a Blog</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#hosting-on-a-service">Hosting on a Service:</a></li><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circle-ci-20">Using Circle CI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li><li><a href="#using-travis-ci">Using Travis CI</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li><li><a href="#publishing-to-github-enterprise">Publishing to GitHub Enterprise</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.3.0/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.3.0/adding-blog"><span>Adding a Blog</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#hosting-on-a-service">Hosting on a Service:</a></li><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circleci-20">Using CircleCI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li><li><a href="#using-travis-ci">Using Travis CI</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li><li><a href="#publishing-to-github-enterprise">Publishing to GitHub Enterprise</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -141,7 +141,7 @@
|
|||
<hr>
|
||||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-publish"></a><a href="#docusaurus-publish" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-publish</code></h3>
|
||||
<p>Alias: <code>publish-gh-pages</code></p>
|
||||
<p><a href="/docs/en/1.3.1/commands#docusaurus-build">Builds</a>, 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:</p>
|
||||
<p><a href="/docs/en/1.3.1/commands#docusaurus-build">Builds</a>, then deploys the static website to GitHub Pages. This command is meant to be run during the deployment step in CircleCI, and therefore expects a few environment variables to be defined:</p>
|
||||
<p>The following environment variables are generally set manually by the user in the CircleCI <code>config.yml</code> file.</p>
|
||||
<ul>
|
||||
<li><code>GIT_USER</code>: The git user to be associated with the deploy commit.</li>
|
||||
|
@ -200,7 +200,7 @@
|
|||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-write-translations"></a><a href="#docusaurus-write-translations" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-write-translations</code></h3>
|
||||
<p>Alias: <code>write-translations</code></p>
|
||||
<p>Writes the English for any strings that need to be translated into an <code>website/i18n/en.json</code> file. The script will go through every file in <code>website/pages/en</code> and through the <code>siteConfig.js</code> file and other config files to fetch English strings that will then be translated on Crowdin. See the <a href="/docs/en/1.3.1/translation">Translation guide</a> to learn more.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-6-15 by =^._.^=</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.3.1/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.3.1/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples"><code>docusaurus-examples</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start"><code>docusaurus-start</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.3.1/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.3.1/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples"><code>docusaurus-examples</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start"><code>docusaurus-start</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -141,7 +141,7 @@
|
|||
<hr>
|
||||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-publish"></a><a href="#docusaurus-publish" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-publish</code></h3>
|
||||
<p>Alias: <code>publish-gh-pages</code></p>
|
||||
<p><a href="/docs/en/1.3.1/commands#docusaurus-build">Builds</a>, 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:</p>
|
||||
<p><a href="/docs/en/1.3.1/commands#docusaurus-build">Builds</a>, then deploys the static website to GitHub Pages. This command is meant to be run during the deployment step in CircleCI, and therefore expects a few environment variables to be defined:</p>
|
||||
<p>The following environment variables are generally set manually by the user in the CircleCI <code>config.yml</code> file.</p>
|
||||
<ul>
|
||||
<li><code>GIT_USER</code>: The git user to be associated with the deploy commit.</li>
|
||||
|
@ -200,7 +200,7 @@
|
|||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-write-translations"></a><a href="#docusaurus-write-translations" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-write-translations</code></h3>
|
||||
<p>Alias: <code>write-translations</code></p>
|
||||
<p>Writes the English for any strings that need to be translated into an <code>website/i18n/en.json</code> file. The script will go through every file in <code>website/pages/en</code> and through the <code>siteConfig.js</code> file and other config files to fetch English strings that will then be translated on Crowdin. See the <a href="/docs/en/1.3.1/translation">Translation guide</a> to learn more.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-6-15 by =^._.^=</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.3.1/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.3.1/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples"><code>docusaurus-examples</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start"><code>docusaurus-start</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.3.1/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.3.1/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples"><code>docusaurus-examples</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start"><code>docusaurus-start</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -113,7 +113,7 @@
|
|||
</tbody>
|
||||
</table>
|
||||
<blockquote>
|
||||
<p>Docusaurus also supports deploying <a href="https://help.github.com/articles/user-organization-and-project-pages/#user--organization-pages">user or organization sites</a>. To do this, just set <code>projectName</code> to "<em>username</em>.github.io" (where <em>username</em> is your username or organization name on GitHub) and <code>organizationName</code> to "<em>username</em>".<br>
|
||||
<p>Docusaurus also supports deploying <a href="https://help.github.com/articles/user-organization-and-project-pages/#user--organization-pages">user or organization sites</a>. To do this, just set <code>projectName</code> to "<em>username</em>.github.io" (where <em>username</em> is your username or organization name on GitHub) and <code>organizationName</code> to "<em>username</em>".
|
||||
For user or org sites, the publish script will deploy these sites to the root of the <code>master</code> branch of the <em>username</em>.github.io repo. In this case, note that you will want to have the Docusaurus infra, your docs, etc. either in another branch of the <em>username</em>.github.io repo (e.g., maybe call it <code>source</code>), or in another, separated repo (e.g. in the same as the documented source code).</p>
|
||||
</blockquote>
|
||||
<blockquote>
|
||||
|
@ -152,14 +152,14 @@ For user or org sites, the publish script will deploy these sites to the root of
|
|||
<p>You can run the command above any time you update the docs and wish to deploy the changes to your site. Running the script manually may be fine for sites where the documentation rarely changes and it is not too much of an inconvenience to remember to manually deploy changes.</p>
|
||||
<p>However, you can automate the publishing process with continuous integration (CI).</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="automating-deployments-using-continuous-integration"></a><a href="#automating-deployments-using-continuous-integration" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Automating Deployments Using Continuous Integration</h2>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">Circle CI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circle-ci-20"></a><a href="#using-circle-ci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using Circle CI 2.0</h3>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">CircleCI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circleci-20"></a><a href="#using-circleci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using CircleCI 2.0</h3>
|
||||
<p>If you haven't done so already, you can <a href="https://circleci.com/signup/">setup CircleCI</a> for your open source project. Afterwards, in order to enable automatic deployment of your site and documentation via CircleCI, just configure Circle to run the <code>publish-gh-pages</code> script as part of the deployment step. You can follow the steps below to get that setup.</p>
|
||||
<ol>
|
||||
<li>Ensure the GitHub account that will be set as the <code>GIT_USER</code> has <code>write</code> access to the repository that contains the documentation, by checking <code>Settings | Collaborators & teams</code> in the repository.</li>
|
||||
<li>Log into GitHub as the <code>GIT_USER</code>.</li>
|
||||
<li>Go to <a href="https://github.com/settings/tokens">https://github.com/settings/tokens</a> for the <code>GIT_USER</code> and generate a new <a href="https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/">personal access token</a>, granting it full control of private repositories through the <code>repository</code> 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.</li>
|
||||
<li>Open your Circle CI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub organization/repository.</li>
|
||||
<li>Open your CircleCI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub organization/repository.</li>
|
||||
<li>Create a new environment variable named <code>GITHUB_TOKEN</code>, using your newly generated access token as the value.</li>
|
||||
<li>Create a <code>.circleci</code> directory and create a <code>config.yml</code> under that directory.</li>
|
||||
<li>Copy the text below into <code>.circleci/config.yml</code>.</li>
|
||||
|
@ -207,11 +207,11 @@ For user or org sites, the publish script will deploy these sites to the root of
|
|||
</blockquote>
|
||||
<p>Now, whenever a new commit lands in <code>master</code>, CircleCI will run your suite of tests and, if everything passes, your website will be deployed via the <code>publish-gh-pages</code> script.</p>
|
||||
<blockquote>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the Circle CI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the CircleCI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
</blockquote>
|
||||
<h3><a class="anchor" aria-hidden="true" id="tips-tricks"></a><a href="#tips-tricks" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Tips & Tricks</h3>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using Circle CI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> 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:</p>
|
||||
<pre><code class="hljs css language-yaml"><span class="hljs-comment"># Circle CI 2.0 Config File</span>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using CircleCI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> branch fail to run successfully due to a lack of tests. You can easily work around this by creating a basic CircleCI config with the following contents:</p>
|
||||
<pre><code class="hljs css language-yaml"><span class="hljs-comment"># CircleCI 2.0 Config File</span>
|
||||
<span class="hljs-comment"># This config file will prevent tests from being run on the gh-pages branch.</span>
|
||||
<span class="hljs-attr">version:</span> <span class="hljs-number">2</span>
|
||||
<span class="hljs-attr">jobs:</span>
|
||||
|
@ -272,7 +272,7 @@ For user or org sites, the publish script will deploy these sites to the root of
|
|||
</tbody>
|
||||
</table>
|
||||
<p>Alter your <code>siteConfig.js</code> to add a property <code>'githubHost'</code> which represents the GitHub Enterprise hostname. Alternatively, set an environment variable <code>GITHUB_HOST</code> when executing the publish command.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-6-14 by Gustavo Henke</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.3.1/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.3.1/adding-blog"><span>Adding a Blog</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#hosting-on-a-service">Hosting on a Service:</a></li><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circle-ci-20">Using Circle CI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li><li><a href="#using-travis-ci">Using Travis CI</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li><li><a href="#publishing-to-github-enterprise">Publishing to GitHub Enterprise</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.3.1/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.3.1/adding-blog"><span>Adding a Blog</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#hosting-on-a-service">Hosting on a Service:</a></li><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circleci-20">Using CircleCI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li><li><a href="#using-travis-ci">Using Travis CI</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li><li><a href="#publishing-to-github-enterprise">Publishing to GitHub Enterprise</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -113,7 +113,7 @@
|
|||
</tbody>
|
||||
</table>
|
||||
<blockquote>
|
||||
<p>Docusaurus also supports deploying <a href="https://help.github.com/articles/user-organization-and-project-pages/#user--organization-pages">user or organization sites</a>. To do this, just set <code>projectName</code> to "<em>username</em>.github.io" (where <em>username</em> is your username or organization name on GitHub) and <code>organizationName</code> to "<em>username</em>".<br>
|
||||
<p>Docusaurus also supports deploying <a href="https://help.github.com/articles/user-organization-and-project-pages/#user--organization-pages">user or organization sites</a>. To do this, just set <code>projectName</code> to "<em>username</em>.github.io" (where <em>username</em> is your username or organization name on GitHub) and <code>organizationName</code> to "<em>username</em>".
|
||||
For user or org sites, the publish script will deploy these sites to the root of the <code>master</code> branch of the <em>username</em>.github.io repo. In this case, note that you will want to have the Docusaurus infra, your docs, etc. either in another branch of the <em>username</em>.github.io repo (e.g., maybe call it <code>source</code>), or in another, separated repo (e.g. in the same as the documented source code).</p>
|
||||
</blockquote>
|
||||
<blockquote>
|
||||
|
@ -152,14 +152,14 @@ For user or org sites, the publish script will deploy these sites to the root of
|
|||
<p>You can run the command above any time you update the docs and wish to deploy the changes to your site. Running the script manually may be fine for sites where the documentation rarely changes and it is not too much of an inconvenience to remember to manually deploy changes.</p>
|
||||
<p>However, you can automate the publishing process with continuous integration (CI).</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="automating-deployments-using-continuous-integration"></a><a href="#automating-deployments-using-continuous-integration" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Automating Deployments Using Continuous Integration</h2>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">Circle CI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circle-ci-20"></a><a href="#using-circle-ci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using Circle CI 2.0</h3>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">CircleCI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circleci-20"></a><a href="#using-circleci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using CircleCI 2.0</h3>
|
||||
<p>If you haven't done so already, you can <a href="https://circleci.com/signup/">setup CircleCI</a> for your open source project. Afterwards, in order to enable automatic deployment of your site and documentation via CircleCI, just configure Circle to run the <code>publish-gh-pages</code> script as part of the deployment step. You can follow the steps below to get that setup.</p>
|
||||
<ol>
|
||||
<li>Ensure the GitHub account that will be set as the <code>GIT_USER</code> has <code>write</code> access to the repository that contains the documentation, by checking <code>Settings | Collaborators & teams</code> in the repository.</li>
|
||||
<li>Log into GitHub as the <code>GIT_USER</code>.</li>
|
||||
<li>Go to <a href="https://github.com/settings/tokens">https://github.com/settings/tokens</a> for the <code>GIT_USER</code> and generate a new <a href="https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/">personal access token</a>, granting it full control of private repositories through the <code>repository</code> 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.</li>
|
||||
<li>Open your Circle CI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub organization/repository.</li>
|
||||
<li>Open your CircleCI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub organization/repository.</li>
|
||||
<li>Create a new environment variable named <code>GITHUB_TOKEN</code>, using your newly generated access token as the value.</li>
|
||||
<li>Create a <code>.circleci</code> directory and create a <code>config.yml</code> under that directory.</li>
|
||||
<li>Copy the text below into <code>.circleci/config.yml</code>.</li>
|
||||
|
@ -207,11 +207,11 @@ For user or org sites, the publish script will deploy these sites to the root of
|
|||
</blockquote>
|
||||
<p>Now, whenever a new commit lands in <code>master</code>, CircleCI will run your suite of tests and, if everything passes, your website will be deployed via the <code>publish-gh-pages</code> script.</p>
|
||||
<blockquote>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the Circle CI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the CircleCI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
</blockquote>
|
||||
<h3><a class="anchor" aria-hidden="true" id="tips-tricks"></a><a href="#tips-tricks" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Tips & Tricks</h3>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using Circle CI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> 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:</p>
|
||||
<pre><code class="hljs css language-yaml"><span class="hljs-comment"># Circle CI 2.0 Config File</span>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using CircleCI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> branch fail to run successfully due to a lack of tests. You can easily work around this by creating a basic CircleCI config with the following contents:</p>
|
||||
<pre><code class="hljs css language-yaml"><span class="hljs-comment"># CircleCI 2.0 Config File</span>
|
||||
<span class="hljs-comment"># This config file will prevent tests from being run on the gh-pages branch.</span>
|
||||
<span class="hljs-attr">version:</span> <span class="hljs-number">2</span>
|
||||
<span class="hljs-attr">jobs:</span>
|
||||
|
@ -272,7 +272,7 @@ For user or org sites, the publish script will deploy these sites to the root of
|
|||
</tbody>
|
||||
</table>
|
||||
<p>Alter your <code>siteConfig.js</code> to add a property <code>'githubHost'</code> which represents the GitHub Enterprise hostname. Alternatively, set an environment variable <code>GITHUB_HOST</code> when executing the publish command.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-6-14 by Gustavo Henke</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.3.1/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.3.1/adding-blog"><span>Adding a Blog</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#hosting-on-a-service">Hosting on a Service:</a></li><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circle-ci-20">Using Circle CI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li><li><a href="#using-travis-ci">Using Travis CI</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li><li><a href="#publishing-to-github-enterprise">Publishing to GitHub Enterprise</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.3.1/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.3.1/adding-blog"><span>Adding a Blog</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#hosting-on-a-service">Hosting on a Service:</a></li><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circleci-20">Using CircleCI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li><li><a href="#using-travis-ci">Using Travis CI</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li><li><a href="#publishing-to-github-enterprise">Publishing to GitHub Enterprise</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -141,7 +141,7 @@
|
|||
<hr>
|
||||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-publish"></a><a href="#docusaurus-publish" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-publish</code></h3>
|
||||
<p>Alias: <code>publish-gh-pages</code></p>
|
||||
<p><a href="/docs/en/1.3.2/commands#docusaurus-build">Builds</a>, 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:</p>
|
||||
<p><a href="/docs/en/1.3.2/commands#docusaurus-build">Builds</a>, then deploys the static website to GitHub Pages. This command is meant to be run during the deployment step in CircleCI, and therefore expects a few environment variables to be defined:</p>
|
||||
<p>The following environment variables are generally set manually by the user in the CircleCI <code>config.yml</code> file.</p>
|
||||
<ul>
|
||||
<li><code>GIT_USER</code>: The git user to be associated with the deploy commit.</li>
|
||||
|
@ -200,7 +200,7 @@
|
|||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-write-translations"></a><a href="#docusaurus-write-translations" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-write-translations</code></h3>
|
||||
<p>Alias: <code>write-translations</code></p>
|
||||
<p>Writes the English for any strings that need to be translated into an <code>website/i18n/en.json</code> file. The script will go through every file in <code>website/pages/en</code> and through the <code>siteConfig.js</code> file and other config files to fetch English strings that will then be translated on Crowdin. See the <a href="/docs/en/1.3.2/translation">Translation guide</a> to learn more.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-6-15 by =^._.^=</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.3.2/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.3.2/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples"><code>docusaurus-examples</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start"><code>docusaurus-start</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.3.2/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.3.2/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples"><code>docusaurus-examples</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start"><code>docusaurus-start</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -141,7 +141,7 @@
|
|||
<hr>
|
||||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-publish"></a><a href="#docusaurus-publish" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-publish</code></h3>
|
||||
<p>Alias: <code>publish-gh-pages</code></p>
|
||||
<p><a href="/docs/en/1.3.2/commands#docusaurus-build">Builds</a>, 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:</p>
|
||||
<p><a href="/docs/en/1.3.2/commands#docusaurus-build">Builds</a>, then deploys the static website to GitHub Pages. This command is meant to be run during the deployment step in CircleCI, and therefore expects a few environment variables to be defined:</p>
|
||||
<p>The following environment variables are generally set manually by the user in the CircleCI <code>config.yml</code> file.</p>
|
||||
<ul>
|
||||
<li><code>GIT_USER</code>: The git user to be associated with the deploy commit.</li>
|
||||
|
@ -200,7 +200,7 @@
|
|||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-write-translations"></a><a href="#docusaurus-write-translations" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-write-translations</code></h3>
|
||||
<p>Alias: <code>write-translations</code></p>
|
||||
<p>Writes the English for any strings that need to be translated into an <code>website/i18n/en.json</code> file. The script will go through every file in <code>website/pages/en</code> and through the <code>siteConfig.js</code> file and other config files to fetch English strings that will then be translated on Crowdin. See the <a href="/docs/en/1.3.2/translation">Translation guide</a> to learn more.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-6-15 by =^._.^=</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.3.2/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.3.2/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples"><code>docusaurus-examples</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start"><code>docusaurus-start</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.3.2/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.3.2/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples"><code>docusaurus-examples</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start"><code>docusaurus-start</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -113,7 +113,7 @@
|
|||
</tbody>
|
||||
</table>
|
||||
<blockquote>
|
||||
<p>Docusaurus also supports deploying <a href="https://help.github.com/articles/user-organization-and-project-pages/#user--organization-pages">user or organization sites</a>. To do this, just set <code>projectName</code> to "<em>username</em>.github.io" (where <em>username</em> is your username or organization name on GitHub) and <code>organizationName</code> to "<em>username</em>".<br>
|
||||
<p>Docusaurus also supports deploying <a href="https://help.github.com/articles/user-organization-and-project-pages/#user--organization-pages">user or organization sites</a>. To do this, just set <code>projectName</code> to "<em>username</em>.github.io" (where <em>username</em> is your username or organization name on GitHub) and <code>organizationName</code> to "<em>username</em>".
|
||||
For user or org sites, the publish script will deploy these sites to the root of the <code>master</code> branch of the <em>username</em>.github.io repo. In this case, note that you will want to have the Docusaurus infra, your docs, etc. either in another branch of the <em>username</em>.github.io repo (e.g., maybe call it <code>source</code>), or in another, separated repo (e.g. in the same as the documented source code).</p>
|
||||
</blockquote>
|
||||
<blockquote>
|
||||
|
@ -152,14 +152,14 @@ For user or org sites, the publish script will deploy these sites to the root of
|
|||
<p>You can run the command above any time you update the docs and wish to deploy the changes to your site. Running the script manually may be fine for sites where the documentation rarely changes and it is not too much of an inconvenience to remember to manually deploy changes.</p>
|
||||
<p>However, you can automate the publishing process with continuous integration (CI).</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="automating-deployments-using-continuous-integration"></a><a href="#automating-deployments-using-continuous-integration" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Automating Deployments Using Continuous Integration</h2>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">Circle CI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circle-ci-20"></a><a href="#using-circle-ci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using Circle CI 2.0</h3>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">CircleCI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circleci-20"></a><a href="#using-circleci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using CircleCI 2.0</h3>
|
||||
<p>If you haven't done so already, you can <a href="https://circleci.com/signup/">setup CircleCI</a> for your open source project. Afterwards, in order to enable automatic deployment of your site and documentation via CircleCI, just configure Circle to run the <code>publish-gh-pages</code> script as part of the deployment step. You can follow the steps below to get that setup.</p>
|
||||
<ol>
|
||||
<li>Ensure the GitHub account that will be set as the <code>GIT_USER</code> has <code>write</code> access to the repository that contains the documentation, by checking <code>Settings | Collaborators & teams</code> in the repository.</li>
|
||||
<li>Log into GitHub as the <code>GIT_USER</code>.</li>
|
||||
<li>Go to <a href="https://github.com/settings/tokens">https://github.com/settings/tokens</a> for the <code>GIT_USER</code> and generate a new <a href="https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/">personal access token</a>, granting it full control of private repositories through the <code>repository</code> 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.</li>
|
||||
<li>Open your Circle CI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub organization/repository.</li>
|
||||
<li>Open your CircleCI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub organization/repository.</li>
|
||||
<li>Create a new environment variable named <code>GITHUB_TOKEN</code>, using your newly generated access token as the value.</li>
|
||||
<li>Create a <code>.circleci</code> directory and create a <code>config.yml</code> under that directory.</li>
|
||||
<li>Copy the text below into <code>.circleci/config.yml</code>.</li>
|
||||
|
@ -207,11 +207,11 @@ For user or org sites, the publish script will deploy these sites to the root of
|
|||
</blockquote>
|
||||
<p>Now, whenever a new commit lands in <code>master</code>, CircleCI will run your suite of tests and, if everything passes, your website will be deployed via the <code>publish-gh-pages</code> script.</p>
|
||||
<blockquote>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the Circle CI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the CircleCI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
</blockquote>
|
||||
<h3><a class="anchor" aria-hidden="true" id="tips-tricks"></a><a href="#tips-tricks" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Tips & Tricks</h3>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using Circle CI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> 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:</p>
|
||||
<pre><code class="hljs css language-yaml"><span class="hljs-comment"># Circle CI 2.0 Config File</span>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using CircleCI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> branch fail to run successfully due to a lack of tests. You can easily work around this by creating a basic CircleCI config with the following contents:</p>
|
||||
<pre><code class="hljs css language-yaml"><span class="hljs-comment"># CircleCI 2.0 Config File</span>
|
||||
<span class="hljs-comment"># This config file will prevent tests from being run on the gh-pages branch.</span>
|
||||
<span class="hljs-attr">version:</span> <span class="hljs-number">2</span>
|
||||
<span class="hljs-attr">jobs:</span>
|
||||
|
@ -272,7 +272,7 @@ For user or org sites, the publish script will deploy these sites to the root of
|
|||
</tbody>
|
||||
</table>
|
||||
<p>Alter your <code>siteConfig.js</code> to add a property <code>'githubHost'</code> which represents the GitHub Enterprise hostname. Alternatively, set an environment variable <code>GITHUB_HOST</code> when executing the publish command.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-6-14 by Gustavo Henke</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.3.2/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.3.2/adding-blog"><span>Adding a Blog</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#hosting-on-a-service">Hosting on a Service:</a></li><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circle-ci-20">Using Circle CI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li><li><a href="#using-travis-ci">Using Travis CI</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li><li><a href="#publishing-to-github-enterprise">Publishing to GitHub Enterprise</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.3.2/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.3.2/adding-blog"><span>Adding a Blog</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#hosting-on-a-service">Hosting on a Service:</a></li><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circleci-20">Using CircleCI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li><li><a href="#using-travis-ci">Using Travis CI</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li><li><a href="#publishing-to-github-enterprise">Publishing to GitHub Enterprise</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -113,7 +113,7 @@
|
|||
</tbody>
|
||||
</table>
|
||||
<blockquote>
|
||||
<p>Docusaurus also supports deploying <a href="https://help.github.com/articles/user-organization-and-project-pages/#user--organization-pages">user or organization sites</a>. To do this, just set <code>projectName</code> to "<em>username</em>.github.io" (where <em>username</em> is your username or organization name on GitHub) and <code>organizationName</code> to "<em>username</em>".<br>
|
||||
<p>Docusaurus also supports deploying <a href="https://help.github.com/articles/user-organization-and-project-pages/#user--organization-pages">user or organization sites</a>. To do this, just set <code>projectName</code> to "<em>username</em>.github.io" (where <em>username</em> is your username or organization name on GitHub) and <code>organizationName</code> to "<em>username</em>".
|
||||
For user or org sites, the publish script will deploy these sites to the root of the <code>master</code> branch of the <em>username</em>.github.io repo. In this case, note that you will want to have the Docusaurus infra, your docs, etc. either in another branch of the <em>username</em>.github.io repo (e.g., maybe call it <code>source</code>), or in another, separated repo (e.g. in the same as the documented source code).</p>
|
||||
</blockquote>
|
||||
<blockquote>
|
||||
|
@ -152,14 +152,14 @@ For user or org sites, the publish script will deploy these sites to the root of
|
|||
<p>You can run the command above any time you update the docs and wish to deploy the changes to your site. Running the script manually may be fine for sites where the documentation rarely changes and it is not too much of an inconvenience to remember to manually deploy changes.</p>
|
||||
<p>However, you can automate the publishing process with continuous integration (CI).</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="automating-deployments-using-continuous-integration"></a><a href="#automating-deployments-using-continuous-integration" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Automating Deployments Using Continuous Integration</h2>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">Circle CI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circle-ci-20"></a><a href="#using-circle-ci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using Circle CI 2.0</h3>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">CircleCI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circleci-20"></a><a href="#using-circleci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using CircleCI 2.0</h3>
|
||||
<p>If you haven't done so already, you can <a href="https://circleci.com/signup/">setup CircleCI</a> for your open source project. Afterwards, in order to enable automatic deployment of your site and documentation via CircleCI, just configure Circle to run the <code>publish-gh-pages</code> script as part of the deployment step. You can follow the steps below to get that setup.</p>
|
||||
<ol>
|
||||
<li>Ensure the GitHub account that will be set as the <code>GIT_USER</code> has <code>write</code> access to the repository that contains the documentation, by checking <code>Settings | Collaborators & teams</code> in the repository.</li>
|
||||
<li>Log into GitHub as the <code>GIT_USER</code>.</li>
|
||||
<li>Go to <a href="https://github.com/settings/tokens">https://github.com/settings/tokens</a> for the <code>GIT_USER</code> and generate a new <a href="https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/">personal access token</a>, granting it full control of private repositories through the <code>repository</code> 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.</li>
|
||||
<li>Open your Circle CI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub organization/repository.</li>
|
||||
<li>Open your CircleCI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub organization/repository.</li>
|
||||
<li>Create a new environment variable named <code>GITHUB_TOKEN</code>, using your newly generated access token as the value.</li>
|
||||
<li>Create a <code>.circleci</code> directory and create a <code>config.yml</code> under that directory.</li>
|
||||
<li>Copy the text below into <code>.circleci/config.yml</code>.</li>
|
||||
|
@ -207,11 +207,11 @@ For user or org sites, the publish script will deploy these sites to the root of
|
|||
</blockquote>
|
||||
<p>Now, whenever a new commit lands in <code>master</code>, CircleCI will run your suite of tests and, if everything passes, your website will be deployed via the <code>publish-gh-pages</code> script.</p>
|
||||
<blockquote>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the Circle CI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the CircleCI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
</blockquote>
|
||||
<h3><a class="anchor" aria-hidden="true" id="tips-tricks"></a><a href="#tips-tricks" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Tips & Tricks</h3>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using Circle CI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> 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:</p>
|
||||
<pre><code class="hljs css language-yaml"><span class="hljs-comment"># Circle CI 2.0 Config File</span>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using CircleCI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> branch fail to run successfully due to a lack of tests. You can easily work around this by creating a basic CircleCI config with the following contents:</p>
|
||||
<pre><code class="hljs css language-yaml"><span class="hljs-comment"># CircleCI 2.0 Config File</span>
|
||||
<span class="hljs-comment"># This config file will prevent tests from being run on the gh-pages branch.</span>
|
||||
<span class="hljs-attr">version:</span> <span class="hljs-number">2</span>
|
||||
<span class="hljs-attr">jobs:</span>
|
||||
|
@ -272,7 +272,7 @@ For user or org sites, the publish script will deploy these sites to the root of
|
|||
</tbody>
|
||||
</table>
|
||||
<p>Alter your <code>siteConfig.js</code> to add a property <code>'githubHost'</code> which represents the GitHub Enterprise hostname. Alternatively, set an environment variable <code>GITHUB_HOST</code> when executing the publish command.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-6-14 by Gustavo Henke</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.3.2/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.3.2/adding-blog"><span>Adding a Blog</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#hosting-on-a-service">Hosting on a Service:</a></li><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circle-ci-20">Using Circle CI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li><li><a href="#using-travis-ci">Using Travis CI</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li><li><a href="#publishing-to-github-enterprise">Publishing to GitHub Enterprise</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.3.2/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.3.2/adding-blog"><span>Adding a Blog</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#hosting-on-a-service">Hosting on a Service:</a></li><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circleci-20">Using CircleCI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li><li><a href="#using-travis-ci">Using Travis CI</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li><li><a href="#publishing-to-github-enterprise">Publishing to GitHub Enterprise</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -141,7 +141,7 @@
|
|||
<hr>
|
||||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-publish"></a><a href="#docusaurus-publish" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-publish</code></h3>
|
||||
<p>Alias: <code>publish-gh-pages</code></p>
|
||||
<p><a href="/docs/en/1.3.3/commands#docusaurus-build">Builds</a>, 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:</p>
|
||||
<p><a href="/docs/en/1.3.3/commands#docusaurus-build">Builds</a>, then deploys the static website to GitHub Pages. This command is meant to be run during the deployment step in CircleCI, and therefore expects a few environment variables to be defined:</p>
|
||||
<p>The following environment variables are generally set manually by the user in the CircleCI <code>config.yml</code> file.</p>
|
||||
<ul>
|
||||
<li><code>GIT_USER</code>: The git user to be associated with the deploy commit.</li>
|
||||
|
@ -200,7 +200,7 @@
|
|||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-write-translations"></a><a href="#docusaurus-write-translations" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-write-translations</code></h3>
|
||||
<p>Alias: <code>write-translations</code></p>
|
||||
<p>Writes the English for any strings that need to be translated into an <code>website/i18n/en.json</code> file. The script will go through every file in <code>website/pages/en</code> and through the <code>siteConfig.js</code> file and other config files to fetch English strings that will then be translated on Crowdin. See the <a href="/docs/en/1.3.3/translation">Translation guide</a> to learn more.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-6-15 by =^._.^=</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.3.3/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.3.3/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples"><code>docusaurus-examples</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start"><code>docusaurus-start</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.3.3/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.3.3/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples"><code>docusaurus-examples</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start"><code>docusaurus-start</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -141,7 +141,7 @@
|
|||
<hr>
|
||||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-publish"></a><a href="#docusaurus-publish" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-publish</code></h3>
|
||||
<p>Alias: <code>publish-gh-pages</code></p>
|
||||
<p><a href="/docs/en/1.3.3/commands#docusaurus-build">Builds</a>, 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:</p>
|
||||
<p><a href="/docs/en/1.3.3/commands#docusaurus-build">Builds</a>, then deploys the static website to GitHub Pages. This command is meant to be run during the deployment step in CircleCI, and therefore expects a few environment variables to be defined:</p>
|
||||
<p>The following environment variables are generally set manually by the user in the CircleCI <code>config.yml</code> file.</p>
|
||||
<ul>
|
||||
<li><code>GIT_USER</code>: The git user to be associated with the deploy commit.</li>
|
||||
|
@ -200,7 +200,7 @@
|
|||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-write-translations"></a><a href="#docusaurus-write-translations" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-write-translations</code></h3>
|
||||
<p>Alias: <code>write-translations</code></p>
|
||||
<p>Writes the English for any strings that need to be translated into an <code>website/i18n/en.json</code> file. The script will go through every file in <code>website/pages/en</code> and through the <code>siteConfig.js</code> file and other config files to fetch English strings that will then be translated on Crowdin. See the <a href="/docs/en/1.3.3/translation">Translation guide</a> to learn more.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-6-15 by =^._.^=</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.3.3/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.3.3/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples"><code>docusaurus-examples</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start"><code>docusaurus-start</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.3.3/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.3.3/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples"><code>docusaurus-examples</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start"><code>docusaurus-start</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -113,7 +113,7 @@
|
|||
</tbody>
|
||||
</table>
|
||||
<blockquote>
|
||||
<p>Docusaurus also supports deploying <a href="https://help.github.com/articles/user-organization-and-project-pages/#user--organization-pages">user or organization sites</a>. To do this, just set <code>projectName</code> to "<em>username</em>.github.io" (where <em>username</em> is your username or organization name on GitHub) and <code>organizationName</code> to "<em>username</em>".<br>
|
||||
<p>Docusaurus also supports deploying <a href="https://help.github.com/articles/user-organization-and-project-pages/#user--organization-pages">user or organization sites</a>. To do this, just set <code>projectName</code> to "<em>username</em>.github.io" (where <em>username</em> is your username or organization name on GitHub) and <code>organizationName</code> to "<em>username</em>".
|
||||
For user or org sites, the publish script will deploy these sites to the root of the <code>master</code> branch of the <em>username</em>.github.io repo. In this case, note that you will want to have the Docusaurus infra, your docs, etc. either in another branch of the <em>username</em>.github.io repo (e.g., maybe call it <code>source</code>), or in another, separated repo (e.g. in the same as the documented source code).</p>
|
||||
</blockquote>
|
||||
<blockquote>
|
||||
|
@ -152,14 +152,14 @@ For user or org sites, the publish script will deploy these sites to the root of
|
|||
<p>You can run the command above any time you update the docs and wish to deploy the changes to your site. Running the script manually may be fine for sites where the documentation rarely changes and it is not too much of an inconvenience to remember to manually deploy changes.</p>
|
||||
<p>However, you can automate the publishing process with continuous integration (CI).</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="automating-deployments-using-continuous-integration"></a><a href="#automating-deployments-using-continuous-integration" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Automating Deployments Using Continuous Integration</h2>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">Circle CI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circle-ci-20"></a><a href="#using-circle-ci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using Circle CI 2.0</h3>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">CircleCI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circleci-20"></a><a href="#using-circleci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using CircleCI 2.0</h3>
|
||||
<p>If you haven't done so already, you can <a href="https://circleci.com/signup/">setup CircleCI</a> for your open source project. Afterwards, in order to enable automatic deployment of your site and documentation via CircleCI, just configure Circle to run the <code>publish-gh-pages</code> script as part of the deployment step. You can follow the steps below to get that setup.</p>
|
||||
<ol>
|
||||
<li>Ensure the GitHub account that will be set as the <code>GIT_USER</code> has <code>write</code> access to the repository that contains the documentation, by checking <code>Settings | Collaborators & teams</code> in the repository.</li>
|
||||
<li>Log into GitHub as the <code>GIT_USER</code>.</li>
|
||||
<li>Go to <a href="https://github.com/settings/tokens">https://github.com/settings/tokens</a> for the <code>GIT_USER</code> and generate a new <a href="https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/">personal access token</a>, granting it full control of private repositories through the <code>repository</code> 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.</li>
|
||||
<li>Open your Circle CI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub organization/repository.</li>
|
||||
<li>Open your CircleCI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub organization/repository.</li>
|
||||
<li>Create a new environment variable named <code>GITHUB_TOKEN</code>, using your newly generated access token as the value.</li>
|
||||
<li>Create a <code>.circleci</code> directory and create a <code>config.yml</code> under that directory.</li>
|
||||
<li>Copy the text below into <code>.circleci/config.yml</code>.</li>
|
||||
|
@ -207,11 +207,11 @@ For user or org sites, the publish script will deploy these sites to the root of
|
|||
</blockquote>
|
||||
<p>Now, whenever a new commit lands in <code>master</code>, CircleCI will run your suite of tests and, if everything passes, your website will be deployed via the <code>publish-gh-pages</code> script.</p>
|
||||
<blockquote>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the Circle CI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the CircleCI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
</blockquote>
|
||||
<h3><a class="anchor" aria-hidden="true" id="tips-tricks"></a><a href="#tips-tricks" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Tips & Tricks</h3>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using Circle CI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> 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:</p>
|
||||
<pre><code class="hljs css language-yaml"><span class="hljs-comment"># Circle CI 2.0 Config File</span>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using CircleCI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> branch fail to run successfully due to a lack of tests. You can easily work around this by creating a basic CircleCI config with the following contents:</p>
|
||||
<pre><code class="hljs css language-yaml"><span class="hljs-comment"># CircleCI 2.0 Config File</span>
|
||||
<span class="hljs-comment"># This config file will prevent tests from being run on the gh-pages branch.</span>
|
||||
<span class="hljs-attr">version:</span> <span class="hljs-number">2</span>
|
||||
<span class="hljs-attr">jobs:</span>
|
||||
|
@ -272,7 +272,7 @@ For user or org sites, the publish script will deploy these sites to the root of
|
|||
</tbody>
|
||||
</table>
|
||||
<p>Alter your <code>siteConfig.js</code> to add a property <code>'githubHost'</code> which represents the GitHub Enterprise hostname. Alternatively, set an environment variable <code>GITHUB_HOST</code> when executing the publish command.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-6-14 by Gustavo Henke</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.3.3/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.3.3/adding-blog"><span>Adding a Blog</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#hosting-on-a-service">Hosting on a Service:</a></li><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circle-ci-20">Using Circle CI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li><li><a href="#using-travis-ci">Using Travis CI</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li><li><a href="#publishing-to-github-enterprise">Publishing to GitHub Enterprise</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.3.3/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.3.3/adding-blog"><span>Adding a Blog</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#hosting-on-a-service">Hosting on a Service:</a></li><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circleci-20">Using CircleCI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li><li><a href="#using-travis-ci">Using Travis CI</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li><li><a href="#publishing-to-github-enterprise">Publishing to GitHub Enterprise</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -113,7 +113,7 @@
|
|||
</tbody>
|
||||
</table>
|
||||
<blockquote>
|
||||
<p>Docusaurus also supports deploying <a href="https://help.github.com/articles/user-organization-and-project-pages/#user--organization-pages">user or organization sites</a>. To do this, just set <code>projectName</code> to "<em>username</em>.github.io" (where <em>username</em> is your username or organization name on GitHub) and <code>organizationName</code> to "<em>username</em>".<br>
|
||||
<p>Docusaurus also supports deploying <a href="https://help.github.com/articles/user-organization-and-project-pages/#user--organization-pages">user or organization sites</a>. To do this, just set <code>projectName</code> to "<em>username</em>.github.io" (where <em>username</em> is your username or organization name on GitHub) and <code>organizationName</code> to "<em>username</em>".
|
||||
For user or org sites, the publish script will deploy these sites to the root of the <code>master</code> branch of the <em>username</em>.github.io repo. In this case, note that you will want to have the Docusaurus infra, your docs, etc. either in another branch of the <em>username</em>.github.io repo (e.g., maybe call it <code>source</code>), or in another, separated repo (e.g. in the same as the documented source code).</p>
|
||||
</blockquote>
|
||||
<blockquote>
|
||||
|
@ -152,14 +152,14 @@ For user or org sites, the publish script will deploy these sites to the root of
|
|||
<p>You can run the command above any time you update the docs and wish to deploy the changes to your site. Running the script manually may be fine for sites where the documentation rarely changes and it is not too much of an inconvenience to remember to manually deploy changes.</p>
|
||||
<p>However, you can automate the publishing process with continuous integration (CI).</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="automating-deployments-using-continuous-integration"></a><a href="#automating-deployments-using-continuous-integration" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Automating Deployments Using Continuous Integration</h2>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">Circle CI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circle-ci-20"></a><a href="#using-circle-ci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using Circle CI 2.0</h3>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">CircleCI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circleci-20"></a><a href="#using-circleci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using CircleCI 2.0</h3>
|
||||
<p>If you haven't done so already, you can <a href="https://circleci.com/signup/">setup CircleCI</a> for your open source project. Afterwards, in order to enable automatic deployment of your site and documentation via CircleCI, just configure Circle to run the <code>publish-gh-pages</code> script as part of the deployment step. You can follow the steps below to get that setup.</p>
|
||||
<ol>
|
||||
<li>Ensure the GitHub account that will be set as the <code>GIT_USER</code> has <code>write</code> access to the repository that contains the documentation, by checking <code>Settings | Collaborators & teams</code> in the repository.</li>
|
||||
<li>Log into GitHub as the <code>GIT_USER</code>.</li>
|
||||
<li>Go to <a href="https://github.com/settings/tokens">https://github.com/settings/tokens</a> for the <code>GIT_USER</code> and generate a new <a href="https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/">personal access token</a>, granting it full control of private repositories through the <code>repository</code> 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.</li>
|
||||
<li>Open your Circle CI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub organization/repository.</li>
|
||||
<li>Open your CircleCI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub organization/repository.</li>
|
||||
<li>Create a new environment variable named <code>GITHUB_TOKEN</code>, using your newly generated access token as the value.</li>
|
||||
<li>Create a <code>.circleci</code> directory and create a <code>config.yml</code> under that directory.</li>
|
||||
<li>Copy the text below into <code>.circleci/config.yml</code>.</li>
|
||||
|
@ -207,11 +207,11 @@ For user or org sites, the publish script will deploy these sites to the root of
|
|||
</blockquote>
|
||||
<p>Now, whenever a new commit lands in <code>master</code>, CircleCI will run your suite of tests and, if everything passes, your website will be deployed via the <code>publish-gh-pages</code> script.</p>
|
||||
<blockquote>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the Circle CI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the CircleCI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
</blockquote>
|
||||
<h3><a class="anchor" aria-hidden="true" id="tips-tricks"></a><a href="#tips-tricks" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Tips & Tricks</h3>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using Circle CI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> 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:</p>
|
||||
<pre><code class="hljs css language-yaml"><span class="hljs-comment"># Circle CI 2.0 Config File</span>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using CircleCI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> branch fail to run successfully due to a lack of tests. You can easily work around this by creating a basic CircleCI config with the following contents:</p>
|
||||
<pre><code class="hljs css language-yaml"><span class="hljs-comment"># CircleCI 2.0 Config File</span>
|
||||
<span class="hljs-comment"># This config file will prevent tests from being run on the gh-pages branch.</span>
|
||||
<span class="hljs-attr">version:</span> <span class="hljs-number">2</span>
|
||||
<span class="hljs-attr">jobs:</span>
|
||||
|
@ -272,7 +272,7 @@ For user or org sites, the publish script will deploy these sites to the root of
|
|||
</tbody>
|
||||
</table>
|
||||
<p>Alter your <code>siteConfig.js</code> to add a property <code>'githubHost'</code> which represents the GitHub Enterprise hostname. Alternatively, set an environment variable <code>GITHUB_HOST</code> when executing the publish command.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-6-14 by Gustavo Henke</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.3.3/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.3.3/adding-blog"><span>Adding a Blog</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#hosting-on-a-service">Hosting on a Service:</a></li><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circle-ci-20">Using Circle CI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li><li><a href="#using-travis-ci">Using Travis CI</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li><li><a href="#publishing-to-github-enterprise">Publishing to GitHub Enterprise</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.3.3/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.3.3/adding-blog"><span>Adding a Blog</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#hosting-on-a-service">Hosting on a Service:</a></li><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circleci-20">Using CircleCI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li><li><a href="#using-travis-ci">Using Travis CI</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li><li><a href="#publishing-to-github-enterprise">Publishing to GitHub Enterprise</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -141,7 +141,7 @@
|
|||
<hr>
|
||||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-publish"></a><a href="#docusaurus-publish" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-publish</code></h3>
|
||||
<p>Alias: <code>publish-gh-pages</code></p>
|
||||
<p><a href="/docs/en/1.4.0/commands#docusaurus-build">Builds</a>, 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:</p>
|
||||
<p><a href="/docs/en/1.4.0/commands#docusaurus-build">Builds</a>, then deploys the static website to GitHub Pages. This command is meant to be run during the deployment step in CircleCI, and therefore expects a few environment variables to be defined:</p>
|
||||
<p>The following environment variables are generally set manually by the user in the CircleCI <code>config.yml</code> file.</p>
|
||||
<ul>
|
||||
<li><code>GIT_USER</code>: The git user to be associated with the deploy commit.</li>
|
||||
|
@ -200,7 +200,7 @@
|
|||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-write-translations"></a><a href="#docusaurus-write-translations" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-write-translations</code></h3>
|
||||
<p>Alias: <code>write-translations</code></p>
|
||||
<p>Writes the English for any strings that need to be translated into an <code>website/i18n/en.json</code> file. The script will go through every file in <code>website/pages/en</code> and through the <code>siteConfig.js</code> file and other config files to fetch English strings that will then be translated on Crowdin. See the <a href="/docs/en/1.4.0/translation">Translation guide</a> to learn more.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-6-15 by =^._.^=</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.4.0/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.4.0/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples"><code>docusaurus-examples</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start"><code>docusaurus-start</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.4.0/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.4.0/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples"><code>docusaurus-examples</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start"><code>docusaurus-start</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -141,7 +141,7 @@
|
|||
<hr>
|
||||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-publish"></a><a href="#docusaurus-publish" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-publish</code></h3>
|
||||
<p>Alias: <code>publish-gh-pages</code></p>
|
||||
<p><a href="/docs/en/1.4.0/commands#docusaurus-build">Builds</a>, 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:</p>
|
||||
<p><a href="/docs/en/1.4.0/commands#docusaurus-build">Builds</a>, then deploys the static website to GitHub Pages. This command is meant to be run during the deployment step in CircleCI, and therefore expects a few environment variables to be defined:</p>
|
||||
<p>The following environment variables are generally set manually by the user in the CircleCI <code>config.yml</code> file.</p>
|
||||
<ul>
|
||||
<li><code>GIT_USER</code>: The git user to be associated with the deploy commit.</li>
|
||||
|
@ -200,7 +200,7 @@
|
|||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-write-translations"></a><a href="#docusaurus-write-translations" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-write-translations</code></h3>
|
||||
<p>Alias: <code>write-translations</code></p>
|
||||
<p>Writes the English for any strings that need to be translated into an <code>website/i18n/en.json</code> file. The script will go through every file in <code>website/pages/en</code> and through the <code>siteConfig.js</code> file and other config files to fetch English strings that will then be translated on Crowdin. See the <a href="/docs/en/1.4.0/translation">Translation guide</a> to learn more.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-6-15 by =^._.^=</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.4.0/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.4.0/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples"><code>docusaurus-examples</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start"><code>docusaurus-start</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.4.0/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.4.0/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples"><code>docusaurus-examples</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start"><code>docusaurus-start</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -113,7 +113,7 @@
|
|||
</tbody>
|
||||
</table>
|
||||
<blockquote>
|
||||
<p>Docusaurus also supports deploying <a href="https://help.github.com/articles/user-organization-and-project-pages/#user--organization-pages">user or organization sites</a>. To do this, just set <code>projectName</code> to "<em>username</em>.github.io" (where <em>username</em> is your username or organization name on GitHub) and <code>organizationName</code> to "<em>username</em>".<br>
|
||||
<p>Docusaurus also supports deploying <a href="https://help.github.com/articles/user-organization-and-project-pages/#user--organization-pages">user or organization sites</a>. To do this, just set <code>projectName</code> to "<em>username</em>.github.io" (where <em>username</em> is your username or organization name on GitHub) and <code>organizationName</code> to "<em>username</em>".
|
||||
For user or org sites, the publish script will deploy these sites to the root of the <code>master</code> branch of the <em>username</em>.github.io repo. In this case, note that you will want to have the Docusaurus infra, your docs, etc. either in another branch of the <em>username</em>.github.io repo (e.g., maybe call it <code>source</code>), or in another, separated repo (e.g. in the same as the documented source code).</p>
|
||||
</blockquote>
|
||||
<blockquote>
|
||||
|
@ -152,14 +152,14 @@ For user or org sites, the publish script will deploy these sites to the root of
|
|||
<p>You can run the command above any time you update the docs and wish to deploy the changes to your site. Running the script manually may be fine for sites where the documentation rarely changes and it is not too much of an inconvenience to remember to manually deploy changes.</p>
|
||||
<p>However, you can automate the publishing process with continuous integration (CI).</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="automating-deployments-using-continuous-integration"></a><a href="#automating-deployments-using-continuous-integration" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Automating Deployments Using Continuous Integration</h2>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">Circle CI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circle-ci-20"></a><a href="#using-circle-ci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using Circle CI 2.0</h3>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">CircleCI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circleci-20"></a><a href="#using-circleci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using CircleCI 2.0</h3>
|
||||
<p>If you haven't done so already, you can <a href="https://circleci.com/signup/">setup CircleCI</a> for your open source project. Afterwards, in order to enable automatic deployment of your site and documentation via CircleCI, just configure Circle to run the <code>publish-gh-pages</code> script as part of the deployment step. You can follow the steps below to get that setup.</p>
|
||||
<ol>
|
||||
<li>Ensure the GitHub account that will be set as the <code>GIT_USER</code> has <code>write</code> access to the repository that contains the documentation, by checking <code>Settings | Collaborators & teams</code> in the repository.</li>
|
||||
<li>Log into GitHub as the <code>GIT_USER</code>.</li>
|
||||
<li>Go to <a href="https://github.com/settings/tokens">https://github.com/settings/tokens</a> for the <code>GIT_USER</code> and generate a new <a href="https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/">personal access token</a>, granting it full control of private repositories through the <code>repository</code> 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.</li>
|
||||
<li>Open your Circle CI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub organization/repository.</li>
|
||||
<li>Open your CircleCI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub organization/repository.</li>
|
||||
<li>Create a new environment variable named <code>GITHUB_TOKEN</code>, using your newly generated access token as the value.</li>
|
||||
<li>Create a <code>.circleci</code> directory and create a <code>config.yml</code> under that directory.</li>
|
||||
<li>Copy the text below into <code>.circleci/config.yml</code>.</li>
|
||||
|
@ -207,11 +207,11 @@ For user or org sites, the publish script will deploy these sites to the root of
|
|||
</blockquote>
|
||||
<p>Now, whenever a new commit lands in <code>master</code>, CircleCI will run your suite of tests and, if everything passes, your website will be deployed via the <code>publish-gh-pages</code> script.</p>
|
||||
<blockquote>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the Circle CI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the CircleCI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
</blockquote>
|
||||
<h3><a class="anchor" aria-hidden="true" id="tips-tricks"></a><a href="#tips-tricks" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Tips & Tricks</h3>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using Circle CI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> 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:</p>
|
||||
<pre><code class="hljs css language-yaml"><span class="hljs-comment"># Circle CI 2.0 Config File</span>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using CircleCI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> branch fail to run successfully due to a lack of tests. You can easily work around this by creating a basic CircleCI config with the following contents:</p>
|
||||
<pre><code class="hljs css language-yaml"><span class="hljs-comment"># CircleCI 2.0 Config File</span>
|
||||
<span class="hljs-comment"># This config file will prevent tests from being run on the gh-pages branch.</span>
|
||||
<span class="hljs-attr">version:</span> <span class="hljs-number">2</span>
|
||||
<span class="hljs-attr">jobs:</span>
|
||||
|
@ -272,7 +272,7 @@ For user or org sites, the publish script will deploy these sites to the root of
|
|||
</tbody>
|
||||
</table>
|
||||
<p>Alter your <code>siteConfig.js</code> to add a property <code>'githubHost'</code> which represents the GitHub Enterprise hostname. Alternatively, set an environment variable <code>GITHUB_HOST</code> when executing the publish command.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-6-14 by Gustavo Henke</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.4.0/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.4.0/docker"><span>Docker</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#hosting-on-a-service">Hosting on a Service:</a></li><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circle-ci-20">Using Circle CI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li><li><a href="#using-travis-ci">Using Travis CI</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li><li><a href="#publishing-to-github-enterprise">Publishing to GitHub Enterprise</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.4.0/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.4.0/docker"><span>Docker</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#hosting-on-a-service">Hosting on a Service:</a></li><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circleci-20">Using CircleCI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li><li><a href="#using-travis-ci">Using Travis CI</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li><li><a href="#publishing-to-github-enterprise">Publishing to GitHub Enterprise</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -113,7 +113,7 @@
|
|||
</tbody>
|
||||
</table>
|
||||
<blockquote>
|
||||
<p>Docusaurus also supports deploying <a href="https://help.github.com/articles/user-organization-and-project-pages/#user--organization-pages">user or organization sites</a>. To do this, just set <code>projectName</code> to "<em>username</em>.github.io" (where <em>username</em> is your username or organization name on GitHub) and <code>organizationName</code> to "<em>username</em>".<br>
|
||||
<p>Docusaurus also supports deploying <a href="https://help.github.com/articles/user-organization-and-project-pages/#user--organization-pages">user or organization sites</a>. To do this, just set <code>projectName</code> to "<em>username</em>.github.io" (where <em>username</em> is your username or organization name on GitHub) and <code>organizationName</code> to "<em>username</em>".
|
||||
For user or org sites, the publish script will deploy these sites to the root of the <code>master</code> branch of the <em>username</em>.github.io repo. In this case, note that you will want to have the Docusaurus infra, your docs, etc. either in another branch of the <em>username</em>.github.io repo (e.g., maybe call it <code>source</code>), or in another, separated repo (e.g. in the same as the documented source code).</p>
|
||||
</blockquote>
|
||||
<blockquote>
|
||||
|
@ -152,14 +152,14 @@ For user or org sites, the publish script will deploy these sites to the root of
|
|||
<p>You can run the command above any time you update the docs and wish to deploy the changes to your site. Running the script manually may be fine for sites where the documentation rarely changes and it is not too much of an inconvenience to remember to manually deploy changes.</p>
|
||||
<p>However, you can automate the publishing process with continuous integration (CI).</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="automating-deployments-using-continuous-integration"></a><a href="#automating-deployments-using-continuous-integration" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Automating Deployments Using Continuous Integration</h2>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">Circle CI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circle-ci-20"></a><a href="#using-circle-ci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using Circle CI 2.0</h3>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">CircleCI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circleci-20"></a><a href="#using-circleci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using CircleCI 2.0</h3>
|
||||
<p>If you haven't done so already, you can <a href="https://circleci.com/signup/">setup CircleCI</a> for your open source project. Afterwards, in order to enable automatic deployment of your site and documentation via CircleCI, just configure Circle to run the <code>publish-gh-pages</code> script as part of the deployment step. You can follow the steps below to get that setup.</p>
|
||||
<ol>
|
||||
<li>Ensure the GitHub account that will be set as the <code>GIT_USER</code> has <code>write</code> access to the repository that contains the documentation, by checking <code>Settings | Collaborators & teams</code> in the repository.</li>
|
||||
<li>Log into GitHub as the <code>GIT_USER</code>.</li>
|
||||
<li>Go to <a href="https://github.com/settings/tokens">https://github.com/settings/tokens</a> for the <code>GIT_USER</code> and generate a new <a href="https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/">personal access token</a>, granting it full control of private repositories through the <code>repository</code> 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.</li>
|
||||
<li>Open your Circle CI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub organization/repository.</li>
|
||||
<li>Open your CircleCI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub organization/repository.</li>
|
||||
<li>Create a new environment variable named <code>GITHUB_TOKEN</code>, using your newly generated access token as the value.</li>
|
||||
<li>Create a <code>.circleci</code> directory and create a <code>config.yml</code> under that directory.</li>
|
||||
<li>Copy the text below into <code>.circleci/config.yml</code>.</li>
|
||||
|
@ -207,11 +207,11 @@ For user or org sites, the publish script will deploy these sites to the root of
|
|||
</blockquote>
|
||||
<p>Now, whenever a new commit lands in <code>master</code>, CircleCI will run your suite of tests and, if everything passes, your website will be deployed via the <code>publish-gh-pages</code> script.</p>
|
||||
<blockquote>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the Circle CI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the CircleCI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
</blockquote>
|
||||
<h3><a class="anchor" aria-hidden="true" id="tips-tricks"></a><a href="#tips-tricks" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Tips & Tricks</h3>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using Circle CI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> 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:</p>
|
||||
<pre><code class="hljs css language-yaml"><span class="hljs-comment"># Circle CI 2.0 Config File</span>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using CircleCI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> branch fail to run successfully due to a lack of tests. You can easily work around this by creating a basic CircleCI config with the following contents:</p>
|
||||
<pre><code class="hljs css language-yaml"><span class="hljs-comment"># CircleCI 2.0 Config File</span>
|
||||
<span class="hljs-comment"># This config file will prevent tests from being run on the gh-pages branch.</span>
|
||||
<span class="hljs-attr">version:</span> <span class="hljs-number">2</span>
|
||||
<span class="hljs-attr">jobs:</span>
|
||||
|
@ -272,7 +272,7 @@ For user or org sites, the publish script will deploy these sites to the root of
|
|||
</tbody>
|
||||
</table>
|
||||
<p>Alter your <code>siteConfig.js</code> to add a property <code>'githubHost'</code> which represents the GitHub Enterprise hostname. Alternatively, set an environment variable <code>GITHUB_HOST</code> when executing the publish command.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-6-14 by Gustavo Henke</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.4.0/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.4.0/docker"><span>Docker</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#hosting-on-a-service">Hosting on a Service:</a></li><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circle-ci-20">Using Circle CI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li><li><a href="#using-travis-ci">Using Travis CI</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li><li><a href="#publishing-to-github-enterprise">Publishing to GitHub Enterprise</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.4.0/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.4.0/docker"><span>Docker</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#hosting-on-a-service">Hosting on a Service:</a></li><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circleci-20">Using CircleCI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li><li><a href="#using-travis-ci">Using Travis CI</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li><li><a href="#publishing-to-github-enterprise">Publishing to GitHub Enterprise</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -141,7 +141,7 @@
|
|||
<hr>
|
||||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-publish"></a><a href="#docusaurus-publish" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-publish</code></h3>
|
||||
<p>Alias: <code>publish-gh-pages</code></p>
|
||||
<p><a href="/docs/en/1.5.0/commands#docusaurus-build">Builds</a>, 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:</p>
|
||||
<p><a href="/docs/en/1.5.0/commands#docusaurus-build">Builds</a>, then deploys the static website to GitHub Pages. This command is meant to be run during the deployment step in CircleCI, and therefore expects a few environment variables to be defined:</p>
|
||||
<p>The following environment variables are generally set manually by the user in the CircleCI <code>config.yml</code> file.</p>
|
||||
<ul>
|
||||
<li><code>GIT_USER</code>: The git user to be associated with the deploy commit.</li>
|
||||
|
@ -200,7 +200,7 @@
|
|||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-write-translations"></a><a href="#docusaurus-write-translations" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-write-translations</code></h3>
|
||||
<p>Alias: <code>write-translations</code></p>
|
||||
<p>Writes the English for any strings that need to be translated into an <code>website/i18n/en.json</code> file. The script will go through every file in <code>website/pages/en</code> and through the <code>siteConfig.js</code> file and other config files to fetch English strings that will then be translated on Crowdin. See the <a href="/docs/en/1.5.0/translation">Translation guide</a> to learn more.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-6-15 by =^._.^=</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.5.0/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.5.0/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples"><code>docusaurus-examples</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start"><code>docusaurus-start</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.5.0/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.5.0/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples"><code>docusaurus-examples</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start"><code>docusaurus-start</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -141,7 +141,7 @@
|
|||
<hr>
|
||||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-publish"></a><a href="#docusaurus-publish" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-publish</code></h3>
|
||||
<p>Alias: <code>publish-gh-pages</code></p>
|
||||
<p><a href="/docs/en/1.5.0/commands#docusaurus-build">Builds</a>, 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:</p>
|
||||
<p><a href="/docs/en/1.5.0/commands#docusaurus-build">Builds</a>, then deploys the static website to GitHub Pages. This command is meant to be run during the deployment step in CircleCI, and therefore expects a few environment variables to be defined:</p>
|
||||
<p>The following environment variables are generally set manually by the user in the CircleCI <code>config.yml</code> file.</p>
|
||||
<ul>
|
||||
<li><code>GIT_USER</code>: The git user to be associated with the deploy commit.</li>
|
||||
|
@ -200,7 +200,7 @@
|
|||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-write-translations"></a><a href="#docusaurus-write-translations" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-write-translations</code></h3>
|
||||
<p>Alias: <code>write-translations</code></p>
|
||||
<p>Writes the English for any strings that need to be translated into an <code>website/i18n/en.json</code> file. The script will go through every file in <code>website/pages/en</code> and through the <code>siteConfig.js</code> file and other config files to fetch English strings that will then be translated on Crowdin. See the <a href="/docs/en/1.5.0/translation">Translation guide</a> to learn more.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-6-15 by =^._.^=</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.5.0/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.5.0/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples"><code>docusaurus-examples</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start"><code>docusaurus-start</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.5.0/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.5.0/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples"><code>docusaurus-examples</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start"><code>docusaurus-start</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -113,7 +113,7 @@
|
|||
</tbody>
|
||||
</table>
|
||||
<blockquote>
|
||||
<p>Docusaurus also supports deploying <a href="https://help.github.com/articles/user-organization-and-project-pages/#user--organization-pages">user or organization sites</a>. To do this, just set <code>projectName</code> to "<em>username</em>.github.io" (where <em>username</em> is your username or organization name on GitHub) and <code>organizationName</code> to "<em>username</em>".<br>
|
||||
<p>Docusaurus also supports deploying <a href="https://help.github.com/articles/user-organization-and-project-pages/#user--organization-pages">user or organization sites</a>. To do this, just set <code>projectName</code> to "<em>username</em>.github.io" (where <em>username</em> is your username or organization name on GitHub) and <code>organizationName</code> to "<em>username</em>".
|
||||
For user or org sites, the publish script will deploy these sites to the root of the <code>master</code> branch of the <em>username</em>.github.io repo. In this case, note that you will want to have the Docusaurus infra, your docs, etc. either in another branch of the <em>username</em>.github.io repo (e.g., maybe call it <code>source</code>), or in another, separated repo (e.g. in the same as the documented source code).</p>
|
||||
</blockquote>
|
||||
<blockquote>
|
||||
|
@ -152,14 +152,14 @@ For user or org sites, the publish script will deploy these sites to the root of
|
|||
<p>You can run the command above any time you update the docs and wish to deploy the changes to your site. Running the script manually may be fine for sites where the documentation rarely changes and it is not too much of an inconvenience to remember to manually deploy changes.</p>
|
||||
<p>However, you can automate the publishing process with continuous integration (CI).</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="automating-deployments-using-continuous-integration"></a><a href="#automating-deployments-using-continuous-integration" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Automating Deployments Using Continuous Integration</h2>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">Circle CI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circle-ci-20"></a><a href="#using-circle-ci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using Circle CI 2.0</h3>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">CircleCI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circleci-20"></a><a href="#using-circleci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using CircleCI 2.0</h3>
|
||||
<p>If you haven't done so already, you can <a href="https://circleci.com/signup/">setup CircleCI</a> for your open source project. Afterwards, in order to enable automatic deployment of your site and documentation via CircleCI, just configure Circle to run the <code>publish-gh-pages</code> script as part of the deployment step. You can follow the steps below to get that setup.</p>
|
||||
<ol>
|
||||
<li>Ensure the GitHub account that will be set as the <code>GIT_USER</code> has <code>write</code> access to the repository that contains the documentation, by checking <code>Settings | Collaborators & teams</code> in the repository.</li>
|
||||
<li>Log into GitHub as the <code>GIT_USER</code>.</li>
|
||||
<li>Go to <a href="https://github.com/settings/tokens">https://github.com/settings/tokens</a> for the <code>GIT_USER</code> and generate a new <a href="https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/">personal access token</a>, granting it full control of private repositories through the <code>repository</code> 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.</li>
|
||||
<li>Open your Circle CI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub organization/repository.</li>
|
||||
<li>Open your CircleCI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub organization/repository.</li>
|
||||
<li>Create a new environment variable named <code>GITHUB_TOKEN</code>, using your newly generated access token as the value.</li>
|
||||
<li>Create a <code>.circleci</code> directory and create a <code>config.yml</code> under that directory.</li>
|
||||
<li>Copy the text below into <code>.circleci/config.yml</code>.</li>
|
||||
|
@ -207,11 +207,11 @@ For user or org sites, the publish script will deploy these sites to the root of
|
|||
</blockquote>
|
||||
<p>Now, whenever a new commit lands in <code>master</code>, CircleCI will run your suite of tests and, if everything passes, your website will be deployed via the <code>publish-gh-pages</code> script.</p>
|
||||
<blockquote>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the Circle CI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the CircleCI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
</blockquote>
|
||||
<h3><a class="anchor" aria-hidden="true" id="tips-tricks"></a><a href="#tips-tricks" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Tips & Tricks</h3>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using Circle CI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> 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:</p>
|
||||
<pre><code class="hljs css language-yaml"><span class="hljs-comment"># Circle CI 2.0 Config File</span>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using CircleCI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> branch fail to run successfully due to a lack of tests. You can easily work around this by creating a basic CircleCI config with the following contents:</p>
|
||||
<pre><code class="hljs css language-yaml"><span class="hljs-comment"># CircleCI 2.0 Config File</span>
|
||||
<span class="hljs-comment"># This config file will prevent tests from being run on the gh-pages branch.</span>
|
||||
<span class="hljs-attr">version:</span> <span class="hljs-number">2</span>
|
||||
<span class="hljs-attr">jobs:</span>
|
||||
|
@ -272,7 +272,7 @@ For user or org sites, the publish script will deploy these sites to the root of
|
|||
</tbody>
|
||||
</table>
|
||||
<p>Alter your <code>siteConfig.js</code> to add a property <code>'githubHost'</code> which represents the GitHub Enterprise hostname. Alternatively, set an environment variable <code>GITHUB_HOST</code> when executing the publish command.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-6-14 by Gustavo Henke</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.5.0/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.5.0/docker"><span>Docker</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#hosting-on-a-service">Hosting on a Service:</a></li><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circle-ci-20">Using Circle CI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li><li><a href="#using-travis-ci">Using Travis CI</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li><li><a href="#publishing-to-github-enterprise">Publishing to GitHub Enterprise</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.5.0/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.5.0/docker"><span>Docker</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#hosting-on-a-service">Hosting on a Service:</a></li><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circleci-20">Using CircleCI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li><li><a href="#using-travis-ci">Using Travis CI</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li><li><a href="#publishing-to-github-enterprise">Publishing to GitHub Enterprise</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -113,7 +113,7 @@
|
|||
</tbody>
|
||||
</table>
|
||||
<blockquote>
|
||||
<p>Docusaurus also supports deploying <a href="https://help.github.com/articles/user-organization-and-project-pages/#user--organization-pages">user or organization sites</a>. To do this, just set <code>projectName</code> to "<em>username</em>.github.io" (where <em>username</em> is your username or organization name on GitHub) and <code>organizationName</code> to "<em>username</em>".<br>
|
||||
<p>Docusaurus also supports deploying <a href="https://help.github.com/articles/user-organization-and-project-pages/#user--organization-pages">user or organization sites</a>. To do this, just set <code>projectName</code> to "<em>username</em>.github.io" (where <em>username</em> is your username or organization name on GitHub) and <code>organizationName</code> to "<em>username</em>".
|
||||
For user or org sites, the publish script will deploy these sites to the root of the <code>master</code> branch of the <em>username</em>.github.io repo. In this case, note that you will want to have the Docusaurus infra, your docs, etc. either in another branch of the <em>username</em>.github.io repo (e.g., maybe call it <code>source</code>), or in another, separated repo (e.g. in the same as the documented source code).</p>
|
||||
</blockquote>
|
||||
<blockquote>
|
||||
|
@ -152,14 +152,14 @@ For user or org sites, the publish script will deploy these sites to the root of
|
|||
<p>You can run the command above any time you update the docs and wish to deploy the changes to your site. Running the script manually may be fine for sites where the documentation rarely changes and it is not too much of an inconvenience to remember to manually deploy changes.</p>
|
||||
<p>However, you can automate the publishing process with continuous integration (CI).</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="automating-deployments-using-continuous-integration"></a><a href="#automating-deployments-using-continuous-integration" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Automating Deployments Using Continuous Integration</h2>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">Circle CI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circle-ci-20"></a><a href="#using-circle-ci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using Circle CI 2.0</h3>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">CircleCI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circleci-20"></a><a href="#using-circleci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using CircleCI 2.0</h3>
|
||||
<p>If you haven't done so already, you can <a href="https://circleci.com/signup/">setup CircleCI</a> for your open source project. Afterwards, in order to enable automatic deployment of your site and documentation via CircleCI, just configure Circle to run the <code>publish-gh-pages</code> script as part of the deployment step. You can follow the steps below to get that setup.</p>
|
||||
<ol>
|
||||
<li>Ensure the GitHub account that will be set as the <code>GIT_USER</code> has <code>write</code> access to the repository that contains the documentation, by checking <code>Settings | Collaborators & teams</code> in the repository.</li>
|
||||
<li>Log into GitHub as the <code>GIT_USER</code>.</li>
|
||||
<li>Go to <a href="https://github.com/settings/tokens">https://github.com/settings/tokens</a> for the <code>GIT_USER</code> and generate a new <a href="https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/">personal access token</a>, granting it full control of private repositories through the <code>repository</code> 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.</li>
|
||||
<li>Open your Circle CI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub organization/repository.</li>
|
||||
<li>Open your CircleCI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub organization/repository.</li>
|
||||
<li>Create a new environment variable named <code>GITHUB_TOKEN</code>, using your newly generated access token as the value.</li>
|
||||
<li>Create a <code>.circleci</code> directory and create a <code>config.yml</code> under that directory.</li>
|
||||
<li>Copy the text below into <code>.circleci/config.yml</code>.</li>
|
||||
|
@ -207,11 +207,11 @@ For user or org sites, the publish script will deploy these sites to the root of
|
|||
</blockquote>
|
||||
<p>Now, whenever a new commit lands in <code>master</code>, CircleCI will run your suite of tests and, if everything passes, your website will be deployed via the <code>publish-gh-pages</code> script.</p>
|
||||
<blockquote>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the Circle CI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the CircleCI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
</blockquote>
|
||||
<h3><a class="anchor" aria-hidden="true" id="tips-tricks"></a><a href="#tips-tricks" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Tips & Tricks</h3>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using Circle CI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> 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:</p>
|
||||
<pre><code class="hljs css language-yaml"><span class="hljs-comment"># Circle CI 2.0 Config File</span>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using CircleCI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> branch fail to run successfully due to a lack of tests. You can easily work around this by creating a basic CircleCI config with the following contents:</p>
|
||||
<pre><code class="hljs css language-yaml"><span class="hljs-comment"># CircleCI 2.0 Config File</span>
|
||||
<span class="hljs-comment"># This config file will prevent tests from being run on the gh-pages branch.</span>
|
||||
<span class="hljs-attr">version:</span> <span class="hljs-number">2</span>
|
||||
<span class="hljs-attr">jobs:</span>
|
||||
|
@ -272,7 +272,7 @@ For user or org sites, the publish script will deploy these sites to the root of
|
|||
</tbody>
|
||||
</table>
|
||||
<p>Alter your <code>siteConfig.js</code> to add a property <code>'githubHost'</code> which represents the GitHub Enterprise hostname. Alternatively, set an environment variable <code>GITHUB_HOST</code> when executing the publish command.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-6-14 by Gustavo Henke</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.5.0/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.5.0/docker"><span>Docker</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#hosting-on-a-service">Hosting on a Service:</a></li><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circle-ci-20">Using Circle CI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li><li><a href="#using-travis-ci">Using Travis CI</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li><li><a href="#publishing-to-github-enterprise">Publishing to GitHub Enterprise</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.5.0/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.5.0/docker"><span>Docker</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#hosting-on-a-service">Hosting on a Service:</a></li><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circleci-20">Using CircleCI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li><li><a href="#using-travis-ci">Using Travis CI</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li><li><a href="#publishing-to-github-enterprise">Publishing to GitHub Enterprise</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -141,7 +141,7 @@
|
|||
<hr>
|
||||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-publish"></a><a href="#docusaurus-publish" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-publish</code></h3>
|
||||
<p>Alias: <code>publish-gh-pages</code></p>
|
||||
<p><a href="/docs/en/1.5.1/commands#docusaurus-build">Builds</a>, 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:</p>
|
||||
<p><a href="/docs/en/1.5.1/commands#docusaurus-build">Builds</a>, then deploys the static website to GitHub Pages. This command is meant to be run during the deployment step in CircleCI, and therefore expects a few environment variables to be defined:</p>
|
||||
<p>The following environment variables are generally set manually by the user in the CircleCI <code>config.yml</code> file.</p>
|
||||
<ul>
|
||||
<li><code>GIT_USER</code>: The git user to be associated with the deploy commit.</li>
|
||||
|
@ -203,7 +203,7 @@
|
|||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-write-translations"></a><a href="#docusaurus-write-translations" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-write-translations</code></h3>
|
||||
<p>Alias: <code>write-translations</code></p>
|
||||
<p>Writes the English for any strings that need to be translated into an <code>website/i18n/en.json</code> file. The script will go through every file in <code>website/pages/en</code> and through the <code>siteConfig.js</code> file and other config files to fetch English strings that will then be translated on Crowdin. See the <a href="/docs/en/1.5.1/translation">Translation guide</a> to learn more.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-10-14 by Tan Li Hau</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.5.1/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.5.1/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples"><code>docusaurus-examples</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start"><code>docusaurus-start</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.5.1/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.5.1/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples"><code>docusaurus-examples</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start"><code>docusaurus-start</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -141,7 +141,7 @@
|
|||
<hr>
|
||||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-publish"></a><a href="#docusaurus-publish" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-publish</code></h3>
|
||||
<p>Alias: <code>publish-gh-pages</code></p>
|
||||
<p><a href="/docs/en/1.5.1/commands#docusaurus-build">Builds</a>, 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:</p>
|
||||
<p><a href="/docs/en/1.5.1/commands#docusaurus-build">Builds</a>, then deploys the static website to GitHub Pages. This command is meant to be run during the deployment step in CircleCI, and therefore expects a few environment variables to be defined:</p>
|
||||
<p>The following environment variables are generally set manually by the user in the CircleCI <code>config.yml</code> file.</p>
|
||||
<ul>
|
||||
<li><code>GIT_USER</code>: The git user to be associated with the deploy commit.</li>
|
||||
|
@ -203,7 +203,7 @@
|
|||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-write-translations"></a><a href="#docusaurus-write-translations" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-write-translations</code></h3>
|
||||
<p>Alias: <code>write-translations</code></p>
|
||||
<p>Writes the English for any strings that need to be translated into an <code>website/i18n/en.json</code> file. The script will go through every file in <code>website/pages/en</code> and through the <code>siteConfig.js</code> file and other config files to fetch English strings that will then be translated on Crowdin. See the <a href="/docs/en/1.5.1/translation">Translation guide</a> to learn more.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-10-14 by Tan Li Hau</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.5.1/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.5.1/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples"><code>docusaurus-examples</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start"><code>docusaurus-start</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.5.1/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.5.1/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples"><code>docusaurus-examples</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start"><code>docusaurus-start</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -165,14 +165,14 @@
|
|||
<p>You can run the command above any time you update the docs and wish to deploy the changes to your site. Running the script manually may be fine for sites where the documentation rarely changes and it is not too much of an inconvenience to remember to manually deploy changes.</p>
|
||||
<p>However, you can automate the publishing process with continuous integration (CI).</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="automating-deployments-using-continuous-integration"></a><a href="#automating-deployments-using-continuous-integration" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Automating Deployments Using Continuous Integration</h2>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">Circle CI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circle-ci-20"></a><a href="#using-circle-ci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using Circle CI 2.0</h3>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">CircleCI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circleci-20"></a><a href="#using-circleci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using CircleCI 2.0</h3>
|
||||
<p>If you haven't done so already, you can <a href="https://circleci.com/signup/">setup CircleCI</a> for your open source project. Afterwards, in order to enable automatic deployment of your site and documentation via CircleCI, just configure Circle to run the <code>publish-gh-pages</code> script as part of the deployment step. You can follow the steps below to get that setup.</p>
|
||||
<ol>
|
||||
<li>Ensure the GitHub account that will be set as the <code>GIT_USER</code> has <code>write</code> access to the repository that contains the documentation, by checking <code>Settings | Collaborators & teams</code> in the repository.</li>
|
||||
<li>Log into GitHub as the <code>GIT_USER</code>.</li>
|
||||
<li>Go to <a href="https://github.com/settings/tokens">https://github.com/settings/tokens</a> for the <code>GIT_USER</code> and generate a new <a href="https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/">personal access token</a>, granting it full control of private repositories through the <code>repository</code> 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.</li>
|
||||
<li>Open your Circle CI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub organization/repository.</li>
|
||||
<li>Open your CircleCI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub organization/repository.</li>
|
||||
<li>Create a new environment variable named <code>GITHUB_TOKEN</code>, using your newly generated access token as the value.</li>
|
||||
<li>Create a <code>.circleci</code> directory and create a <code>config.yml</code> under that directory.</li>
|
||||
<li>Copy the text below into <code>.circleci/config.yml</code>.</li>
|
||||
|
@ -220,11 +220,11 @@
|
|||
</blockquote>
|
||||
<p>Now, whenever a new commit lands in <code>master</code>, CircleCI will run your suite of tests and, if everything passes, your website will be deployed via the <code>publish-gh-pages</code> script.</p>
|
||||
<blockquote>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the Circle CI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the CircleCI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
</blockquote>
|
||||
<h3><a class="anchor" aria-hidden="true" id="tips-tricks"></a><a href="#tips-tricks" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Tips & Tricks</h3>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using Circle CI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> 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:</p>
|
||||
<pre><code class="hljs css language-yaml"><span class="hljs-comment"># Circle CI 2.0 Config File</span>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using CircleCI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> branch fail to run successfully due to a lack of tests. You can easily work around this by creating a basic CircleCI config with the following contents:</p>
|
||||
<pre><code class="hljs css language-yaml"><span class="hljs-comment"># CircleCI 2.0 Config File</span>
|
||||
<span class="hljs-comment"># This config file will prevent tests from being run on the gh-pages branch.</span>
|
||||
<span class="hljs-attr">version:</span> <span class="hljs-number">2</span>
|
||||
<span class="hljs-attr">jobs:</span>
|
||||
|
@ -285,7 +285,7 @@
|
|||
</tbody>
|
||||
</table>
|
||||
<p>Alter your <code>siteConfig.js</code> to add a property <code>'githubHost'</code> which represents the GitHub Enterprise hostname. Alternatively, set an environment variable <code>GITHUB_HOST</code> when executing the publish command.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-10-21 by M4rk9696</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.5.1/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.5.1/docker"><span>Docker</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#hosting-on-a-service">Hosting on a Service:</a></li><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circle-ci-20">Using Circle CI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li><li><a href="#using-travis-ci">Using Travis CI</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li><li><a href="#publishing-to-github-enterprise">Publishing to GitHub Enterprise</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.5.1/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.5.1/docker"><span>Docker</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#hosting-on-a-service">Hosting on a Service:</a></li><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circleci-20">Using CircleCI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li><li><a href="#using-travis-ci">Using Travis CI</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li><li><a href="#publishing-to-github-enterprise">Publishing to GitHub Enterprise</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -165,14 +165,14 @@
|
|||
<p>You can run the command above any time you update the docs and wish to deploy the changes to your site. Running the script manually may be fine for sites where the documentation rarely changes and it is not too much of an inconvenience to remember to manually deploy changes.</p>
|
||||
<p>However, you can automate the publishing process with continuous integration (CI).</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="automating-deployments-using-continuous-integration"></a><a href="#automating-deployments-using-continuous-integration" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Automating Deployments Using Continuous Integration</h2>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">Circle CI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circle-ci-20"></a><a href="#using-circle-ci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using Circle CI 2.0</h3>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">CircleCI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circleci-20"></a><a href="#using-circleci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using CircleCI 2.0</h3>
|
||||
<p>If you haven't done so already, you can <a href="https://circleci.com/signup/">setup CircleCI</a> for your open source project. Afterwards, in order to enable automatic deployment of your site and documentation via CircleCI, just configure Circle to run the <code>publish-gh-pages</code> script as part of the deployment step. You can follow the steps below to get that setup.</p>
|
||||
<ol>
|
||||
<li>Ensure the GitHub account that will be set as the <code>GIT_USER</code> has <code>write</code> access to the repository that contains the documentation, by checking <code>Settings | Collaborators & teams</code> in the repository.</li>
|
||||
<li>Log into GitHub as the <code>GIT_USER</code>.</li>
|
||||
<li>Go to <a href="https://github.com/settings/tokens">https://github.com/settings/tokens</a> for the <code>GIT_USER</code> and generate a new <a href="https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/">personal access token</a>, granting it full control of private repositories through the <code>repository</code> 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.</li>
|
||||
<li>Open your Circle CI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub organization/repository.</li>
|
||||
<li>Open your CircleCI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub organization/repository.</li>
|
||||
<li>Create a new environment variable named <code>GITHUB_TOKEN</code>, using your newly generated access token as the value.</li>
|
||||
<li>Create a <code>.circleci</code> directory and create a <code>config.yml</code> under that directory.</li>
|
||||
<li>Copy the text below into <code>.circleci/config.yml</code>.</li>
|
||||
|
@ -220,11 +220,11 @@
|
|||
</blockquote>
|
||||
<p>Now, whenever a new commit lands in <code>master</code>, CircleCI will run your suite of tests and, if everything passes, your website will be deployed via the <code>publish-gh-pages</code> script.</p>
|
||||
<blockquote>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the Circle CI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the CircleCI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
</blockquote>
|
||||
<h3><a class="anchor" aria-hidden="true" id="tips-tricks"></a><a href="#tips-tricks" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Tips & Tricks</h3>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using Circle CI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> 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:</p>
|
||||
<pre><code class="hljs css language-yaml"><span class="hljs-comment"># Circle CI 2.0 Config File</span>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using CircleCI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> branch fail to run successfully due to a lack of tests. You can easily work around this by creating a basic CircleCI config with the following contents:</p>
|
||||
<pre><code class="hljs css language-yaml"><span class="hljs-comment"># CircleCI 2.0 Config File</span>
|
||||
<span class="hljs-comment"># This config file will prevent tests from being run on the gh-pages branch.</span>
|
||||
<span class="hljs-attr">version:</span> <span class="hljs-number">2</span>
|
||||
<span class="hljs-attr">jobs:</span>
|
||||
|
@ -285,7 +285,7 @@
|
|||
</tbody>
|
||||
</table>
|
||||
<p>Alter your <code>siteConfig.js</code> to add a property <code>'githubHost'</code> which represents the GitHub Enterprise hostname. Alternatively, set an environment variable <code>GITHUB_HOST</code> when executing the publish command.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-10-21 by M4rk9696</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.5.1/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.5.1/docker"><span>Docker</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#hosting-on-a-service">Hosting on a Service:</a></li><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circle-ci-20">Using Circle CI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li><li><a href="#using-travis-ci">Using Travis CI</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li><li><a href="#publishing-to-github-enterprise">Publishing to GitHub Enterprise</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.5.1/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.5.1/docker"><span>Docker</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#hosting-on-a-service">Hosting on a Service:</a></li><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circleci-20">Using CircleCI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li><li><a href="#using-travis-ci">Using Travis CI</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li><li><a href="#publishing-to-github-enterprise">Publishing to GitHub Enterprise</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -141,7 +141,7 @@
|
|||
<hr>
|
||||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-publish"></a><a href="#docusaurus-publish" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-publish</code></h3>
|
||||
<p>Alias: <code>publish-gh-pages</code></p>
|
||||
<p><a href="/docs/en/1.6.0/commands#docusaurus-build">Builds</a>, 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:</p>
|
||||
<p><a href="/docs/en/1.6.0/commands#docusaurus-build">Builds</a>, then deploys the static website to GitHub Pages. This command is meant to be run during the deployment step in CircleCI, and therefore expects a few environment variables to be defined:</p>
|
||||
<p>The following environment variables are generally set manually by the user in the CircleCI <code>config.yml</code> file.</p>
|
||||
<ul>
|
||||
<li><code>GIT_USER</code>: The git user to be associated with the deploy commit.</li>
|
||||
|
@ -203,7 +203,7 @@
|
|||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-write-translations"></a><a href="#docusaurus-write-translations" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-write-translations</code></h3>
|
||||
<p>Alias: <code>write-translations</code></p>
|
||||
<p>Writes the English for any strings that need to be translated into an <code>website/i18n/en.json</code> file. The script will go through every file in <code>website/pages/en</code> and through the <code>siteConfig.js</code> file and other config files to fetch English strings that will then be translated on Crowdin. See the <a href="/docs/en/1.6.0/translation">Translation guide</a> to learn more.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-10-14 by Tan Li Hau</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.6.0/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.6.0/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples"><code>docusaurus-examples</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start"><code>docusaurus-start</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.6.0/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.6.0/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples"><code>docusaurus-examples</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start"><code>docusaurus-start</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -141,7 +141,7 @@
|
|||
<hr>
|
||||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-publish"></a><a href="#docusaurus-publish" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-publish</code></h3>
|
||||
<p>Alias: <code>publish-gh-pages</code></p>
|
||||
<p><a href="/docs/en/1.6.0/commands#docusaurus-build">Builds</a>, 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:</p>
|
||||
<p><a href="/docs/en/1.6.0/commands#docusaurus-build">Builds</a>, then deploys the static website to GitHub Pages. This command is meant to be run during the deployment step in CircleCI, and therefore expects a few environment variables to be defined:</p>
|
||||
<p>The following environment variables are generally set manually by the user in the CircleCI <code>config.yml</code> file.</p>
|
||||
<ul>
|
||||
<li><code>GIT_USER</code>: The git user to be associated with the deploy commit.</li>
|
||||
|
@ -203,7 +203,7 @@
|
|||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-write-translations"></a><a href="#docusaurus-write-translations" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-write-translations</code></h3>
|
||||
<p>Alias: <code>write-translations</code></p>
|
||||
<p>Writes the English for any strings that need to be translated into an <code>website/i18n/en.json</code> file. The script will go through every file in <code>website/pages/en</code> and through the <code>siteConfig.js</code> file and other config files to fetch English strings that will then be translated on Crowdin. See the <a href="/docs/en/1.6.0/translation">Translation guide</a> to learn more.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-10-14 by Tan Li Hau</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.6.0/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.6.0/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples"><code>docusaurus-examples</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start"><code>docusaurus-start</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.6.0/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.6.0/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples"><code>docusaurus-examples</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start"><code>docusaurus-start</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -165,14 +165,14 @@
|
|||
<p>You can run the command above any time you update the docs and wish to deploy the changes to your site. Running the script manually may be fine for sites where the documentation rarely changes and it is not too much of an inconvenience to remember to manually deploy changes.</p>
|
||||
<p>However, you can automate the publishing process with continuous integration (CI).</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="automating-deployments-using-continuous-integration"></a><a href="#automating-deployments-using-continuous-integration" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Automating Deployments Using Continuous Integration</h2>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">Circle CI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circle-ci-20"></a><a href="#using-circle-ci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using Circle CI 2.0</h3>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">CircleCI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circleci-20"></a><a href="#using-circleci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using CircleCI 2.0</h3>
|
||||
<p>If you haven't done so already, you can <a href="https://circleci.com/signup/">setup CircleCI</a> for your open source project. Afterwards, in order to enable automatic deployment of your site and documentation via CircleCI, just configure Circle to run the <code>publish-gh-pages</code> script as part of the deployment step. You can follow the steps below to get that setup.</p>
|
||||
<ol>
|
||||
<li>Ensure the GitHub account that will be set as the <code>GIT_USER</code> has <code>write</code> access to the repository that contains the documentation, by checking <code>Settings | Collaborators & teams</code> in the repository.</li>
|
||||
<li>Log into GitHub as the <code>GIT_USER</code>.</li>
|
||||
<li>Go to <a href="https://github.com/settings/tokens">https://github.com/settings/tokens</a> for the <code>GIT_USER</code> and generate a new <a href="https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/">personal access token</a>, granting it full control of private repositories through the <code>repository</code> 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.</li>
|
||||
<li>Open your Circle CI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub organization/repository.</li>
|
||||
<li>Open your CircleCI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub organization/repository.</li>
|
||||
<li>Create a new environment variable named <code>GITHUB_TOKEN</code>, using your newly generated access token as the value.</li>
|
||||
<li>Create a <code>.circleci</code> directory and create a <code>config.yml</code> under that directory.</li>
|
||||
<li>Copy the text below into <code>.circleci/config.yml</code>.</li>
|
||||
|
@ -220,11 +220,11 @@
|
|||
</blockquote>
|
||||
<p>Now, whenever a new commit lands in <code>master</code>, CircleCI will run your suite of tests and, if everything passes, your website will be deployed via the <code>publish-gh-pages</code> script.</p>
|
||||
<blockquote>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the Circle CI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the CircleCI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
</blockquote>
|
||||
<h3><a class="anchor" aria-hidden="true" id="tips-tricks"></a><a href="#tips-tricks" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Tips & Tricks</h3>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using Circle CI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> 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:</p>
|
||||
<pre><code class="hljs css language-yaml"><span class="hljs-comment"># Circle CI 2.0 Config File</span>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using CircleCI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> branch fail to run successfully due to a lack of tests. You can easily work around this by creating a basic CircleCI config with the following contents:</p>
|
||||
<pre><code class="hljs css language-yaml"><span class="hljs-comment"># CircleCI 2.0 Config File</span>
|
||||
<span class="hljs-comment"># This config file will prevent tests from being run on the gh-pages branch.</span>
|
||||
<span class="hljs-attr">version:</span> <span class="hljs-number">2</span>
|
||||
<span class="hljs-attr">jobs:</span>
|
||||
|
@ -285,7 +285,7 @@
|
|||
</tbody>
|
||||
</table>
|
||||
<p>Alter your <code>siteConfig.js</code> to add a property <code>'githubHost'</code> which represents the GitHub Enterprise hostname. Alternatively, set an environment variable <code>GITHUB_HOST</code> when executing the publish command.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-10-21 by M4rk9696</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.6.0/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.6.0/docker"><span>Docker</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#hosting-on-a-service">Hosting on a Service:</a></li><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circle-ci-20">Using Circle CI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li><li><a href="#using-travis-ci">Using Travis CI</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li><li><a href="#publishing-to-github-enterprise">Publishing to GitHub Enterprise</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.6.0/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.6.0/docker"><span>Docker</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#hosting-on-a-service">Hosting on a Service:</a></li><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circleci-20">Using CircleCI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li><li><a href="#using-travis-ci">Using Travis CI</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li><li><a href="#publishing-to-github-enterprise">Publishing to GitHub Enterprise</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -165,14 +165,14 @@
|
|||
<p>You can run the command above any time you update the docs and wish to deploy the changes to your site. Running the script manually may be fine for sites where the documentation rarely changes and it is not too much of an inconvenience to remember to manually deploy changes.</p>
|
||||
<p>However, you can automate the publishing process with continuous integration (CI).</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="automating-deployments-using-continuous-integration"></a><a href="#automating-deployments-using-continuous-integration" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Automating Deployments Using Continuous Integration</h2>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">Circle CI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circle-ci-20"></a><a href="#using-circle-ci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using Circle CI 2.0</h3>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">CircleCI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circleci-20"></a><a href="#using-circleci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using CircleCI 2.0</h3>
|
||||
<p>If you haven't done so already, you can <a href="https://circleci.com/signup/">setup CircleCI</a> for your open source project. Afterwards, in order to enable automatic deployment of your site and documentation via CircleCI, just configure Circle to run the <code>publish-gh-pages</code> script as part of the deployment step. You can follow the steps below to get that setup.</p>
|
||||
<ol>
|
||||
<li>Ensure the GitHub account that will be set as the <code>GIT_USER</code> has <code>write</code> access to the repository that contains the documentation, by checking <code>Settings | Collaborators & teams</code> in the repository.</li>
|
||||
<li>Log into GitHub as the <code>GIT_USER</code>.</li>
|
||||
<li>Go to <a href="https://github.com/settings/tokens">https://github.com/settings/tokens</a> for the <code>GIT_USER</code> and generate a new <a href="https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/">personal access token</a>, granting it full control of private repositories through the <code>repository</code> 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.</li>
|
||||
<li>Open your Circle CI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub organization/repository.</li>
|
||||
<li>Open your CircleCI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub organization/repository.</li>
|
||||
<li>Create a new environment variable named <code>GITHUB_TOKEN</code>, using your newly generated access token as the value.</li>
|
||||
<li>Create a <code>.circleci</code> directory and create a <code>config.yml</code> under that directory.</li>
|
||||
<li>Copy the text below into <code>.circleci/config.yml</code>.</li>
|
||||
|
@ -220,11 +220,11 @@
|
|||
</blockquote>
|
||||
<p>Now, whenever a new commit lands in <code>master</code>, CircleCI will run your suite of tests and, if everything passes, your website will be deployed via the <code>publish-gh-pages</code> script.</p>
|
||||
<blockquote>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the Circle CI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the CircleCI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
</blockquote>
|
||||
<h3><a class="anchor" aria-hidden="true" id="tips-tricks"></a><a href="#tips-tricks" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Tips & Tricks</h3>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using Circle CI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> 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:</p>
|
||||
<pre><code class="hljs css language-yaml"><span class="hljs-comment"># Circle CI 2.0 Config File</span>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using CircleCI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> branch fail to run successfully due to a lack of tests. You can easily work around this by creating a basic CircleCI config with the following contents:</p>
|
||||
<pre><code class="hljs css language-yaml"><span class="hljs-comment"># CircleCI 2.0 Config File</span>
|
||||
<span class="hljs-comment"># This config file will prevent tests from being run on the gh-pages branch.</span>
|
||||
<span class="hljs-attr">version:</span> <span class="hljs-number">2</span>
|
||||
<span class="hljs-attr">jobs:</span>
|
||||
|
@ -285,7 +285,7 @@
|
|||
</tbody>
|
||||
</table>
|
||||
<p>Alter your <code>siteConfig.js</code> to add a property <code>'githubHost'</code> which represents the GitHub Enterprise hostname. Alternatively, set an environment variable <code>GITHUB_HOST</code> when executing the publish command.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-10-21 by M4rk9696</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.6.0/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.6.0/docker"><span>Docker</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#hosting-on-a-service">Hosting on a Service:</a></li><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circle-ci-20">Using Circle CI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li><li><a href="#using-travis-ci">Using Travis CI</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li><li><a href="#publishing-to-github-enterprise">Publishing to GitHub Enterprise</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.6.0/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.6.0/docker"><span>Docker</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#hosting-on-a-service">Hosting on a Service:</a></li><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circleci-20">Using CircleCI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li><li><a href="#using-travis-ci">Using Travis CI</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li><li><a href="#publishing-to-github-enterprise">Publishing to GitHub Enterprise</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -141,7 +141,7 @@
|
|||
<hr>
|
||||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-publish"></a><a href="#docusaurus-publish" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-publish</code></h3>
|
||||
<p>Alias: <code>publish-gh-pages</code></p>
|
||||
<p><a href="/docs/en/1.6.1/commands#docusaurus-build">Builds</a>, 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:</p>
|
||||
<p><a href="/docs/en/1.6.1/commands#docusaurus-build">Builds</a>, then deploys the static website to GitHub Pages. This command is meant to be run during the deployment step in CircleCI, and therefore expects a few environment variables to be defined:</p>
|
||||
<p>The following environment variables are generally set manually by the user in the CircleCI <code>config.yml</code> file.</p>
|
||||
<ul>
|
||||
<li><code>GIT_USER</code>: The git user to be associated with the deploy commit.</li>
|
||||
|
@ -203,7 +203,7 @@
|
|||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-write-translations"></a><a href="#docusaurus-write-translations" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-write-translations</code></h3>
|
||||
<p>Alias: <code>write-translations</code></p>
|
||||
<p>Writes the English for any strings that need to be translated into an <code>website/i18n/en.json</code> file. The script will go through every file in <code>website/pages/en</code> and through the <code>siteConfig.js</code> file and other config files to fetch English strings that will then be translated on Crowdin. See the <a href="/docs/en/1.6.1/translation">Translation guide</a> to learn more.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-10-14 by Tan Li Hau</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.6.1/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.6.1/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples"><code>docusaurus-examples</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start"><code>docusaurus-start</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.6.1/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.6.1/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples"><code>docusaurus-examples</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start"><code>docusaurus-start</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -141,7 +141,7 @@
|
|||
<hr>
|
||||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-publish"></a><a href="#docusaurus-publish" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-publish</code></h3>
|
||||
<p>Alias: <code>publish-gh-pages</code></p>
|
||||
<p><a href="/docs/en/1.6.1/commands#docusaurus-build">Builds</a>, 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:</p>
|
||||
<p><a href="/docs/en/1.6.1/commands#docusaurus-build">Builds</a>, then deploys the static website to GitHub Pages. This command is meant to be run during the deployment step in CircleCI, and therefore expects a few environment variables to be defined:</p>
|
||||
<p>The following environment variables are generally set manually by the user in the CircleCI <code>config.yml</code> file.</p>
|
||||
<ul>
|
||||
<li><code>GIT_USER</code>: The git user to be associated with the deploy commit.</li>
|
||||
|
@ -203,7 +203,7 @@
|
|||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-write-translations"></a><a href="#docusaurus-write-translations" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-write-translations</code></h3>
|
||||
<p>Alias: <code>write-translations</code></p>
|
||||
<p>Writes the English for any strings that need to be translated into an <code>website/i18n/en.json</code> file. The script will go through every file in <code>website/pages/en</code> and through the <code>siteConfig.js</code> file and other config files to fetch English strings that will then be translated on Crowdin. See the <a href="/docs/en/1.6.1/translation">Translation guide</a> to learn more.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-10-14 by Tan Li Hau</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.6.1/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.6.1/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples"><code>docusaurus-examples</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start"><code>docusaurus-start</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.6.1/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.6.1/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples"><code>docusaurus-examples</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start"><code>docusaurus-start</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -165,14 +165,14 @@
|
|||
<p>You can run the command above any time you update the docs and wish to deploy the changes to your site. Running the script manually may be fine for sites where the documentation rarely changes and it is not too much of an inconvenience to remember to manually deploy changes.</p>
|
||||
<p>However, you can automate the publishing process with continuous integration (CI).</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="automating-deployments-using-continuous-integration"></a><a href="#automating-deployments-using-continuous-integration" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Automating Deployments Using Continuous Integration</h2>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">Circle CI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circle-ci-20"></a><a href="#using-circle-ci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using Circle CI 2.0</h3>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">CircleCI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circleci-20"></a><a href="#using-circleci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using CircleCI 2.0</h3>
|
||||
<p>If you haven't done so already, you can <a href="https://circleci.com/signup/">setup CircleCI</a> for your open source project. Afterwards, in order to enable automatic deployment of your site and documentation via CircleCI, just configure Circle to run the <code>publish-gh-pages</code> script as part of the deployment step. You can follow the steps below to get that setup.</p>
|
||||
<ol>
|
||||
<li>Ensure the GitHub account that will be set as the <code>GIT_USER</code> has <code>write</code> access to the repository that contains the documentation, by checking <code>Settings | Collaborators & teams</code> in the repository.</li>
|
||||
<li>Log into GitHub as the <code>GIT_USER</code>.</li>
|
||||
<li>Go to <a href="https://github.com/settings/tokens">https://github.com/settings/tokens</a> for the <code>GIT_USER</code> and generate a new <a href="https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/">personal access token</a>, granting it full control of private repositories through the <code>repository</code> 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.</li>
|
||||
<li>Open your Circle CI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub organization/repository.</li>
|
||||
<li>Open your CircleCI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub organization/repository.</li>
|
||||
<li>Create a new environment variable named <code>GITHUB_TOKEN</code>, using your newly generated access token as the value.</li>
|
||||
<li>Create a <code>.circleci</code> directory and create a <code>config.yml</code> under that directory.</li>
|
||||
<li>Copy the text below into <code>.circleci/config.yml</code>.</li>
|
||||
|
@ -220,10 +220,10 @@
|
|||
</blockquote>
|
||||
<p>Now, whenever a new commit lands in <code>master</code>, CircleCI will run your suite of tests and, if everything passes, your website will be deployed via the <code>publish-gh-pages</code> script.</p>
|
||||
<blockquote>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the Circle CI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the CircleCI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
</blockquote>
|
||||
<h3><a class="anchor" aria-hidden="true" id="tips-tricks"></a><a href="#tips-tricks" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Tips & Tricks</h3>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using Circle CI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> branch fail to run successfully due to a lack of tests (This can also result in chat/slack build failure notifications).</p>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using CircleCI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> branch fail to run successfully due to a lack of tests (This can also result in chat/slack build failure notifications).</p>
|
||||
<p>You can work around this easily by:</p>
|
||||
<ul>
|
||||
<li>Setting the environment variable <code>CUSTOM_COMMIT_MESSAGE</code> flag to the <code>publish-gh-pages</code> command with the contents of <code>[skip ci]</code>.
|
||||
|
@ -233,9 +233,9 @@ e.g.</li>
|
|||
yarn run publish-gh-pages <span class="hljs-comment"># or `npm run publish-gh-pages`</span>
|
||||
</code></pre>
|
||||
<ul>
|
||||
<li>Alternatively you can work around this by creating a basic Circle CI config with the following contents:</li>
|
||||
<li>Alternatively you can work around this by creating a basic CircleCI config with the following contents:</li>
|
||||
</ul>
|
||||
<pre><code class="hljs css language-yaml"><span class="hljs-comment"># Circle CI 2.0 Config File</span>
|
||||
<pre><code class="hljs css language-yaml"><span class="hljs-comment"># CircleCI 2.0 Config File</span>
|
||||
<span class="hljs-comment"># This config file will prevent tests from being run on the gh-pages branch.</span>
|
||||
<span class="hljs-attr">version:</span> <span class="hljs-number">2</span>
|
||||
<span class="hljs-attr">jobs:</span>
|
||||
|
@ -296,7 +296,7 @@ e.g.</li>
|
|||
</tbody>
|
||||
</table>
|
||||
<p>Alter your <code>siteConfig.js</code> to add a property <code>'githubHost'</code> which represents the GitHub Enterprise hostname. Alternatively, set an environment variable <code>GITHUB_HOST</code> when executing the publish command.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-12-4 by Jake Bolam</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.6.1/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.6.1/docker"><span>Docker</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#hosting-on-a-service">Hosting on a Service:</a></li><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circle-ci-20">Using Circle CI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li><li><a href="#using-travis-ci">Using Travis CI</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li><li><a href="#publishing-to-github-enterprise">Publishing to GitHub Enterprise</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.6.1/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.6.1/docker"><span>Docker</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#hosting-on-a-service">Hosting on a Service:</a></li><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circleci-20">Using CircleCI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li><li><a href="#using-travis-ci">Using Travis CI</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li><li><a href="#publishing-to-github-enterprise">Publishing to GitHub Enterprise</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -165,14 +165,14 @@
|
|||
<p>You can run the command above any time you update the docs and wish to deploy the changes to your site. Running the script manually may be fine for sites where the documentation rarely changes and it is not too much of an inconvenience to remember to manually deploy changes.</p>
|
||||
<p>However, you can automate the publishing process with continuous integration (CI).</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="automating-deployments-using-continuous-integration"></a><a href="#automating-deployments-using-continuous-integration" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Automating Deployments Using Continuous Integration</h2>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">Circle CI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circle-ci-20"></a><a href="#using-circle-ci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using Circle CI 2.0</h3>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">CircleCI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circleci-20"></a><a href="#using-circleci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using CircleCI 2.0</h3>
|
||||
<p>If you haven't done so already, you can <a href="https://circleci.com/signup/">setup CircleCI</a> for your open source project. Afterwards, in order to enable automatic deployment of your site and documentation via CircleCI, just configure Circle to run the <code>publish-gh-pages</code> script as part of the deployment step. You can follow the steps below to get that setup.</p>
|
||||
<ol>
|
||||
<li>Ensure the GitHub account that will be set as the <code>GIT_USER</code> has <code>write</code> access to the repository that contains the documentation, by checking <code>Settings | Collaborators & teams</code> in the repository.</li>
|
||||
<li>Log into GitHub as the <code>GIT_USER</code>.</li>
|
||||
<li>Go to <a href="https://github.com/settings/tokens">https://github.com/settings/tokens</a> for the <code>GIT_USER</code> and generate a new <a href="https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/">personal access token</a>, granting it full control of private repositories through the <code>repository</code> 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.</li>
|
||||
<li>Open your Circle CI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub organization/repository.</li>
|
||||
<li>Open your CircleCI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub organization/repository.</li>
|
||||
<li>Create a new environment variable named <code>GITHUB_TOKEN</code>, using your newly generated access token as the value.</li>
|
||||
<li>Create a <code>.circleci</code> directory and create a <code>config.yml</code> under that directory.</li>
|
||||
<li>Copy the text below into <code>.circleci/config.yml</code>.</li>
|
||||
|
@ -220,10 +220,10 @@
|
|||
</blockquote>
|
||||
<p>Now, whenever a new commit lands in <code>master</code>, CircleCI will run your suite of tests and, if everything passes, your website will be deployed via the <code>publish-gh-pages</code> script.</p>
|
||||
<blockquote>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the Circle CI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the CircleCI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
</blockquote>
|
||||
<h3><a class="anchor" aria-hidden="true" id="tips-tricks"></a><a href="#tips-tricks" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Tips & Tricks</h3>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using Circle CI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> branch fail to run successfully due to a lack of tests (This can also result in chat/slack build failure notifications).</p>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using CircleCI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> branch fail to run successfully due to a lack of tests (This can also result in chat/slack build failure notifications).</p>
|
||||
<p>You can work around this easily by:</p>
|
||||
<ul>
|
||||
<li>Setting the environment variable <code>CUSTOM_COMMIT_MESSAGE</code> flag to the <code>publish-gh-pages</code> command with the contents of <code>[skip ci]</code>.
|
||||
|
@ -233,9 +233,9 @@ e.g.</li>
|
|||
yarn run publish-gh-pages <span class="hljs-comment"># or `npm run publish-gh-pages`</span>
|
||||
</code></pre>
|
||||
<ul>
|
||||
<li>Alternatively you can work around this by creating a basic Circle CI config with the following contents:</li>
|
||||
<li>Alternatively you can work around this by creating a basic CircleCI config with the following contents:</li>
|
||||
</ul>
|
||||
<pre><code class="hljs css language-yaml"><span class="hljs-comment"># Circle CI 2.0 Config File</span>
|
||||
<pre><code class="hljs css language-yaml"><span class="hljs-comment"># CircleCI 2.0 Config File</span>
|
||||
<span class="hljs-comment"># This config file will prevent tests from being run on the gh-pages branch.</span>
|
||||
<span class="hljs-attr">version:</span> <span class="hljs-number">2</span>
|
||||
<span class="hljs-attr">jobs:</span>
|
||||
|
@ -296,7 +296,7 @@ e.g.</li>
|
|||
</tbody>
|
||||
</table>
|
||||
<p>Alter your <code>siteConfig.js</code> to add a property <code>'githubHost'</code> which represents the GitHub Enterprise hostname. Alternatively, set an environment variable <code>GITHUB_HOST</code> when executing the publish command.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-12-4 by Jake Bolam</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.6.1/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.6.1/docker"><span>Docker</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#hosting-on-a-service">Hosting on a Service:</a></li><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circle-ci-20">Using Circle CI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li><li><a href="#using-travis-ci">Using Travis CI</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li><li><a href="#publishing-to-github-enterprise">Publishing to GitHub Enterprise</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.6.1/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.6.1/docker"><span>Docker</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#hosting-on-a-service">Hosting on a Service:</a></li><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circleci-20">Using CircleCI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li><li><a href="#using-travis-ci">Using Travis CI</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li><li><a href="#publishing-to-github-enterprise">Publishing to GitHub Enterprise</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -141,7 +141,7 @@
|
|||
<hr>
|
||||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-publish"></a><a href="#docusaurus-publish" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-publish</code></h3>
|
||||
<p>Alias: <code>publish-gh-pages</code></p>
|
||||
<p><a href="/docs/en/1.6.2/commands#docusaurus-build">Builds</a>, 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:</p>
|
||||
<p><a href="/docs/en/1.6.2/commands#docusaurus-build">Builds</a>, then deploys the static website to GitHub Pages. This command is meant to be run during the deployment step in CircleCI, and therefore expects a few environment variables to be defined:</p>
|
||||
<p>The following environment variables are generally set manually by the user in the CircleCI <code>config.yml</code> file.</p>
|
||||
<ul>
|
||||
<li><code>GIT_USER</code>: The git user to be associated with the deploy commit.</li>
|
||||
|
@ -203,7 +203,7 @@
|
|||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-write-translations"></a><a href="#docusaurus-write-translations" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-write-translations</code></h3>
|
||||
<p>Alias: <code>write-translations</code></p>
|
||||
<p>Writes the English for any strings that need to be translated into an <code>website/i18n/en.json</code> file. The script will go through every file in <code>website/pages/en</code> and through the <code>siteConfig.js</code> file and other config files to fetch English strings that will then be translated on Crowdin. See the <a href="/docs/en/1.6.2/translation">Translation guide</a> to learn more.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-10-14 by Tan Li Hau</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.6.2/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.6.2/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples"><code>docusaurus-examples</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start"><code>docusaurus-start</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.6.2/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.6.2/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples"><code>docusaurus-examples</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start"><code>docusaurus-start</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -141,7 +141,7 @@
|
|||
<hr>
|
||||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-publish"></a><a href="#docusaurus-publish" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-publish</code></h3>
|
||||
<p>Alias: <code>publish-gh-pages</code></p>
|
||||
<p><a href="/docs/en/1.6.2/commands#docusaurus-build">Builds</a>, 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:</p>
|
||||
<p><a href="/docs/en/1.6.2/commands#docusaurus-build">Builds</a>, then deploys the static website to GitHub Pages. This command is meant to be run during the deployment step in CircleCI, and therefore expects a few environment variables to be defined:</p>
|
||||
<p>The following environment variables are generally set manually by the user in the CircleCI <code>config.yml</code> file.</p>
|
||||
<ul>
|
||||
<li><code>GIT_USER</code>: The git user to be associated with the deploy commit.</li>
|
||||
|
@ -203,7 +203,7 @@
|
|||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-write-translations"></a><a href="#docusaurus-write-translations" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-write-translations</code></h3>
|
||||
<p>Alias: <code>write-translations</code></p>
|
||||
<p>Writes the English for any strings that need to be translated into an <code>website/i18n/en.json</code> file. The script will go through every file in <code>website/pages/en</code> and through the <code>siteConfig.js</code> file and other config files to fetch English strings that will then be translated on Crowdin. See the <a href="/docs/en/1.6.2/translation">Translation guide</a> to learn more.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-10-14 by Tan Li Hau</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.6.2/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.6.2/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples"><code>docusaurus-examples</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start"><code>docusaurus-start</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.6.2/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.6.2/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples"><code>docusaurus-examples</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start"><code>docusaurus-start</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -165,14 +165,14 @@
|
|||
<p>You can run the command above any time you update the docs and wish to deploy the changes to your site. Running the script manually may be fine for sites where the documentation rarely changes and it is not too much of an inconvenience to remember to manually deploy changes.</p>
|
||||
<p>However, you can automate the publishing process with continuous integration (CI).</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="automating-deployments-using-continuous-integration"></a><a href="#automating-deployments-using-continuous-integration" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Automating Deployments Using Continuous Integration</h2>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">Circle CI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circle-ci-20"></a><a href="#using-circle-ci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using Circle CI 2.0</h3>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">CircleCI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circleci-20"></a><a href="#using-circleci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using CircleCI 2.0</h3>
|
||||
<p>If you haven't done so already, you can <a href="https://circleci.com/signup/">setup CircleCI</a> for your open source project. Afterwards, in order to enable automatic deployment of your site and documentation via CircleCI, just configure Circle to run the <code>publish-gh-pages</code> script as part of the deployment step. You can follow the steps below to get that setup.</p>
|
||||
<ol>
|
||||
<li>Ensure the GitHub account that will be set as the <code>GIT_USER</code> has <code>write</code> access to the repository that contains the documentation, by checking <code>Settings | Collaborators & teams</code> in the repository.</li>
|
||||
<li>Log into GitHub as the <code>GIT_USER</code>.</li>
|
||||
<li>Go to <a href="https://github.com/settings/tokens">https://github.com/settings/tokens</a> for the <code>GIT_USER</code> and generate a new <a href="https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/">personal access token</a>, granting it full control of private repositories through the <code>repository</code> 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.</li>
|
||||
<li>Open your Circle CI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub organization/repository.</li>
|
||||
<li>Open your CircleCI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub organization/repository.</li>
|
||||
<li>Create a new environment variable named <code>GITHUB_TOKEN</code>, using your newly generated access token as the value.</li>
|
||||
<li>Create a <code>.circleci</code> directory and create a <code>config.yml</code> under that directory.</li>
|
||||
<li>Copy the text below into <code>.circleci/config.yml</code>.</li>
|
||||
|
@ -220,10 +220,10 @@
|
|||
</blockquote>
|
||||
<p>Now, whenever a new commit lands in <code>master</code>, CircleCI will run your suite of tests and, if everything passes, your website will be deployed via the <code>publish-gh-pages</code> script.</p>
|
||||
<blockquote>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the Circle CI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the CircleCI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
</blockquote>
|
||||
<h3><a class="anchor" aria-hidden="true" id="tips-tricks"></a><a href="#tips-tricks" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Tips & Tricks</h3>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using Circle CI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> branch fail to run successfully due to a lack of tests (This can also result in chat/slack build failure notifications).</p>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using CircleCI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> branch fail to run successfully due to a lack of tests (This can also result in chat/slack build failure notifications).</p>
|
||||
<p>You can work around this easily by:</p>
|
||||
<ul>
|
||||
<li>Setting the environment variable <code>CUSTOM_COMMIT_MESSAGE</code> flag to the <code>publish-gh-pages</code> command with the contents of <code>[skip ci]</code>.
|
||||
|
@ -233,9 +233,9 @@ e.g.</li>
|
|||
yarn run publish-gh-pages <span class="hljs-comment"># or `npm run publish-gh-pages`</span>
|
||||
</code></pre>
|
||||
<ul>
|
||||
<li>Alternatively you can work around this by creating a basic Circle CI config with the following contents:</li>
|
||||
<li>Alternatively you can work around this by creating a basic CircleCI config with the following contents:</li>
|
||||
</ul>
|
||||
<pre><code class="hljs css language-yaml"><span class="hljs-comment"># Circle CI 2.0 Config File</span>
|
||||
<pre><code class="hljs css language-yaml"><span class="hljs-comment"># CircleCI 2.0 Config File</span>
|
||||
<span class="hljs-comment"># This config file will prevent tests from being run on the gh-pages branch.</span>
|
||||
<span class="hljs-attr">version:</span> <span class="hljs-number">2</span>
|
||||
<span class="hljs-attr">jobs:</span>
|
||||
|
@ -296,7 +296,7 @@ e.g.</li>
|
|||
</tbody>
|
||||
</table>
|
||||
<p>Alter your <code>siteConfig.js</code> to add a property <code>'githubHost'</code> which represents the GitHub Enterprise hostname. Alternatively, set an environment variable <code>GITHUB_HOST</code> when executing the publish command.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-12-4 by Jake Bolam</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.6.2/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.6.2/docker"><span>Docker</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#hosting-on-a-service">Hosting on a Service:</a></li><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circle-ci-20">Using Circle CI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li><li><a href="#using-travis-ci">Using Travis CI</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li><li><a href="#publishing-to-github-enterprise">Publishing to GitHub Enterprise</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.6.2/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.6.2/docker"><span>Docker</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#hosting-on-a-service">Hosting on a Service:</a></li><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circleci-20">Using CircleCI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li><li><a href="#using-travis-ci">Using Travis CI</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li><li><a href="#publishing-to-github-enterprise">Publishing to GitHub Enterprise</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -165,14 +165,14 @@
|
|||
<p>You can run the command above any time you update the docs and wish to deploy the changes to your site. Running the script manually may be fine for sites where the documentation rarely changes and it is not too much of an inconvenience to remember to manually deploy changes.</p>
|
||||
<p>However, you can automate the publishing process with continuous integration (CI).</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="automating-deployments-using-continuous-integration"></a><a href="#automating-deployments-using-continuous-integration" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Automating Deployments Using Continuous Integration</h2>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">Circle CI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circle-ci-20"></a><a href="#using-circle-ci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using Circle CI 2.0</h3>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">CircleCI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circleci-20"></a><a href="#using-circleci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using CircleCI 2.0</h3>
|
||||
<p>If you haven't done so already, you can <a href="https://circleci.com/signup/">setup CircleCI</a> for your open source project. Afterwards, in order to enable automatic deployment of your site and documentation via CircleCI, just configure Circle to run the <code>publish-gh-pages</code> script as part of the deployment step. You can follow the steps below to get that setup.</p>
|
||||
<ol>
|
||||
<li>Ensure the GitHub account that will be set as the <code>GIT_USER</code> has <code>write</code> access to the repository that contains the documentation, by checking <code>Settings | Collaborators & teams</code> in the repository.</li>
|
||||
<li>Log into GitHub as the <code>GIT_USER</code>.</li>
|
||||
<li>Go to <a href="https://github.com/settings/tokens">https://github.com/settings/tokens</a> for the <code>GIT_USER</code> and generate a new <a href="https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/">personal access token</a>, granting it full control of private repositories through the <code>repository</code> 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.</li>
|
||||
<li>Open your Circle CI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub organization/repository.</li>
|
||||
<li>Open your CircleCI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub organization/repository.</li>
|
||||
<li>Create a new environment variable named <code>GITHUB_TOKEN</code>, using your newly generated access token as the value.</li>
|
||||
<li>Create a <code>.circleci</code> directory and create a <code>config.yml</code> under that directory.</li>
|
||||
<li>Copy the text below into <code>.circleci/config.yml</code>.</li>
|
||||
|
@ -220,10 +220,10 @@
|
|||
</blockquote>
|
||||
<p>Now, whenever a new commit lands in <code>master</code>, CircleCI will run your suite of tests and, if everything passes, your website will be deployed via the <code>publish-gh-pages</code> script.</p>
|
||||
<blockquote>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the Circle CI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the CircleCI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
</blockquote>
|
||||
<h3><a class="anchor" aria-hidden="true" id="tips-tricks"></a><a href="#tips-tricks" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Tips & Tricks</h3>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using Circle CI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> branch fail to run successfully due to a lack of tests (This can also result in chat/slack build failure notifications).</p>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using CircleCI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> branch fail to run successfully due to a lack of tests (This can also result in chat/slack build failure notifications).</p>
|
||||
<p>You can work around this easily by:</p>
|
||||
<ul>
|
||||
<li>Setting the environment variable <code>CUSTOM_COMMIT_MESSAGE</code> flag to the <code>publish-gh-pages</code> command with the contents of <code>[skip ci]</code>.
|
||||
|
@ -233,9 +233,9 @@ e.g.</li>
|
|||
yarn run publish-gh-pages <span class="hljs-comment"># or `npm run publish-gh-pages`</span>
|
||||
</code></pre>
|
||||
<ul>
|
||||
<li>Alternatively you can work around this by creating a basic Circle CI config with the following contents:</li>
|
||||
<li>Alternatively you can work around this by creating a basic CircleCI config with the following contents:</li>
|
||||
</ul>
|
||||
<pre><code class="hljs css language-yaml"><span class="hljs-comment"># Circle CI 2.0 Config File</span>
|
||||
<pre><code class="hljs css language-yaml"><span class="hljs-comment"># CircleCI 2.0 Config File</span>
|
||||
<span class="hljs-comment"># This config file will prevent tests from being run on the gh-pages branch.</span>
|
||||
<span class="hljs-attr">version:</span> <span class="hljs-number">2</span>
|
||||
<span class="hljs-attr">jobs:</span>
|
||||
|
@ -296,7 +296,7 @@ e.g.</li>
|
|||
</tbody>
|
||||
</table>
|
||||
<p>Alter your <code>siteConfig.js</code> to add a property <code>'githubHost'</code> which represents the GitHub Enterprise hostname. Alternatively, set an environment variable <code>GITHUB_HOST</code> when executing the publish command.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-12-4 by Jake Bolam</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.6.2/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.6.2/docker"><span>Docker</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#hosting-on-a-service">Hosting on a Service:</a></li><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circle-ci-20">Using Circle CI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li><li><a href="#using-travis-ci">Using Travis CI</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li><li><a href="#publishing-to-github-enterprise">Publishing to GitHub Enterprise</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.6.2/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.6.2/docker"><span>Docker</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#hosting-on-a-service">Hosting on a Service:</a></li><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circleci-20">Using CircleCI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li><li><a href="#using-travis-ci">Using Travis CI</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li><li><a href="#publishing-to-github-enterprise">Publishing to GitHub Enterprise</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -141,7 +141,7 @@
|
|||
<hr>
|
||||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-publish"></a><a href="#docusaurus-publish" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-publish</code></h3>
|
||||
<p>Alias: <code>publish-gh-pages</code></p>
|
||||
<p><a href="/docs/en/1.7.0/commands#docusaurus-build">Builds</a>, 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:</p>
|
||||
<p><a href="/docs/en/1.7.0/commands#docusaurus-build">Builds</a>, then deploys the static website to GitHub Pages. This command is meant to be run during the deployment step in CircleCI, and therefore expects a few environment variables to be defined:</p>
|
||||
<p>The following environment variables are generally set manually by the user in the CircleCI <code>config.yml</code> file.</p>
|
||||
<ul>
|
||||
<li><code>GIT_USER</code>: The git user to be associated with the deploy commit.</li>
|
||||
|
@ -203,7 +203,7 @@
|
|||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-write-translations"></a><a href="#docusaurus-write-translations" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-write-translations</code></h3>
|
||||
<p>Alias: <code>write-translations</code></p>
|
||||
<p>Writes the English for any strings that need to be translated into an <code>website/i18n/en.json</code> file. The script will go through every file in <code>website/pages/en</code> and through the <code>siteConfig.js</code> file and other config files to fetch English strings that will then be translated on Crowdin. See the <a href="/docs/en/1.7.0/translation">Translation guide</a> to learn more.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-10-14 by Tan Li Hau</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.7.0/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.7.0/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples"><code>docusaurus-examples</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start"><code>docusaurus-start</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.7.0/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.7.0/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples"><code>docusaurus-examples</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start"><code>docusaurus-start</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -141,7 +141,7 @@
|
|||
<hr>
|
||||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-publish"></a><a href="#docusaurus-publish" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-publish</code></h3>
|
||||
<p>Alias: <code>publish-gh-pages</code></p>
|
||||
<p><a href="/docs/en/1.7.0/commands#docusaurus-build">Builds</a>, 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:</p>
|
||||
<p><a href="/docs/en/1.7.0/commands#docusaurus-build">Builds</a>, then deploys the static website to GitHub Pages. This command is meant to be run during the deployment step in CircleCI, and therefore expects a few environment variables to be defined:</p>
|
||||
<p>The following environment variables are generally set manually by the user in the CircleCI <code>config.yml</code> file.</p>
|
||||
<ul>
|
||||
<li><code>GIT_USER</code>: The git user to be associated with the deploy commit.</li>
|
||||
|
@ -203,7 +203,7 @@
|
|||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-write-translations"></a><a href="#docusaurus-write-translations" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-write-translations</code></h3>
|
||||
<p>Alias: <code>write-translations</code></p>
|
||||
<p>Writes the English for any strings that need to be translated into an <code>website/i18n/en.json</code> file. The script will go through every file in <code>website/pages/en</code> and through the <code>siteConfig.js</code> file and other config files to fetch English strings that will then be translated on Crowdin. See the <a href="/docs/en/1.7.0/translation">Translation guide</a> to learn more.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2018-10-14 by Tan Li Hau</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.7.0/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.7.0/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples"><code>docusaurus-examples</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start"><code>docusaurus-start</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.7.0/versioning"><span class="arrow-prev">← </span><span>Versioning</span></a><a class="docs-next button" href="/docs/en/1.7.0/doc-markdown"><span>Markdown Features</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples"><code>docusaurus-examples</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start"><code>docusaurus-start</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
|
@ -158,10 +158,10 @@ Text describing my function
|
|||
<p>Adding the following code to your Markdown file:</p>
|
||||
<script src="https://gist.github.com/yangshun/d36d04f383c40beb3f31dd2a16666f6c.js"></script>
|
||||
<p>produces this:</p>
|
||||
<div class="tabs"><div class="nav-tabs"><div id="tab-group-21-tab-22" class="nav-link active" data-group="group_21" data-tab="tab-group-21-content-22">JavaScript</div><div id="tab-group-21-tab-23" class="nav-link" data-group="group_21" data-tab="tab-group-21-content-23">Python</div><div id="tab-group-21-tab-24" class="nav-link" data-group="group_21" data-tab="tab-group-21-content-24">C</div><div id="tab-group-21-tab-25" class="nav-link" data-group="group_21" data-tab="tab-group-21-content-25">Pascal</div></div><div class="tab-content"><div id="tab-group-21-content-22" class="tab-pane active" data-group="group_21" tabindex="-1"><div><span><pre><code class="hljs css language-js"><span class="hljs-built_in">console</span>.log(<span class="hljs-string">'Hello, world!'</span>);<br /></code></pre>
|
||||
</span></div></div><div id="tab-group-21-content-23" class="tab-pane" data-group="group_21" tabindex="-1"><div><span><pre><code class="hljs css language-py">print(<span class="hljs-string">'Hello, world!'</span>)<br /></code></pre>
|
||||
</span></div></div><div id="tab-group-21-content-24" class="tab-pane" data-group="group_21" tabindex="-1"><div><span><pre><code class="hljs css language-C"><span class="hljs-meta">#<span class="hljs-meta-keyword">include</span> <span class="hljs-meta-string"><stdio.h></span></span><br /><br /><span class="hljs-function"><span class="hljs-keyword">int</span> <span class="hljs-title">main</span><span class="hljs-params">()</span> </span>{<br /> <span class="hljs-built_in">printf</span>(<span class="hljs-string">"Hello World!"</span>);<br /> <span class="hljs-keyword">return</span> <span class="hljs-number">0</span>;<br />}<br /></code></pre>
|
||||
</span></div></div><div id="tab-group-21-content-25" class="tab-pane" data-group="group_21" tabindex="-1"><div><span><pre><code class="hljs css language-Pascal"><span class="hljs-keyword">program</span> HelloWorld;<br /><span class="hljs-keyword">begin</span><br /> WriteLn(<span class="hljs-string">'Hello, world!'</span>);<br /><span class="hljs-keyword">end</span>.<br /></code></pre>
|
||||
<div class="tabs"><div class="nav-tabs"><div id="tab-group-41-tab-42" class="nav-link active" data-group="group_41" data-tab="tab-group-41-content-42">JavaScript</div><div id="tab-group-41-tab-43" class="nav-link" data-group="group_41" data-tab="tab-group-41-content-43">Python</div><div id="tab-group-41-tab-44" class="nav-link" data-group="group_41" data-tab="tab-group-41-content-44">C</div><div id="tab-group-41-tab-45" class="nav-link" data-group="group_41" data-tab="tab-group-41-content-45">Pascal</div></div><div class="tab-content"><div id="tab-group-41-content-42" class="tab-pane active" data-group="group_41" tabindex="-1"><div><span><pre><code class="hljs css language-js"><span class="hljs-built_in">console</span>.log(<span class="hljs-string">'Hello, world!'</span>);<br /></code></pre>
|
||||
</span></div></div><div id="tab-group-41-content-43" class="tab-pane" data-group="group_41" tabindex="-1"><div><span><pre><code class="hljs css language-py">print(<span class="hljs-string">'Hello, world!'</span>)<br /></code></pre>
|
||||
</span></div></div><div id="tab-group-41-content-44" class="tab-pane" data-group="group_41" tabindex="-1"><div><span><pre><code class="hljs css language-C"><span class="hljs-meta">#<span class="hljs-meta-keyword">include</span> <span class="hljs-meta-string"><stdio.h></span></span><br /><br /><span class="hljs-function"><span class="hljs-keyword">int</span> <span class="hljs-title">main</span><span class="hljs-params">()</span> </span>{<br /> <span class="hljs-built_in">printf</span>(<span class="hljs-string">"Hello World!"</span>);<br /> <span class="hljs-keyword">return</span> <span class="hljs-number">0</span>;<br />}<br /></code></pre>
|
||||
</span></div></div><div id="tab-group-41-content-45" class="tab-pane" data-group="group_41" tabindex="-1"><div><span><pre><code class="hljs css language-Pascal"><span class="hljs-keyword">program</span> HelloWorld;<br /><span class="hljs-keyword">begin</span><br /> WriteLn(<span class="hljs-string">'Hello, world!'</span>);<br /><span class="hljs-keyword">end</span>.<br /></code></pre>
|
||||
</span></div></div></div></div>
|
||||
<h2><a class="anchor" aria-hidden="true" id="syntax-highlighting"></a><a href="#syntax-highlighting" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Syntax Highlighting</h2>
|
||||
<p>Syntax highlighting is enabled by default on fenced code blocks. The language should be detected automatically, but you can sometimes get better results by specifying the language. You can do so using an <a href="https://github.github.com/gfm/#example-111">info string</a>, following the three opening backticks. The following JavaScript example...</p>
|
||||
|
|
|
@ -158,10 +158,10 @@ Text describing my function
|
|||
<p>Adding the following code to your Markdown file:</p>
|
||||
<script src="https://gist.github.com/yangshun/d36d04f383c40beb3f31dd2a16666f6c.js"></script>
|
||||
<p>produces this:</p>
|
||||
<div class="tabs"><div class="nav-tabs"><div id="tab-group-21-tab-22" class="nav-link active" data-group="group_21" data-tab="tab-group-21-content-22">JavaScript</div><div id="tab-group-21-tab-23" class="nav-link" data-group="group_21" data-tab="tab-group-21-content-23">Python</div><div id="tab-group-21-tab-24" class="nav-link" data-group="group_21" data-tab="tab-group-21-content-24">C</div><div id="tab-group-21-tab-25" class="nav-link" data-group="group_21" data-tab="tab-group-21-content-25">Pascal</div></div><div class="tab-content"><div id="tab-group-21-content-22" class="tab-pane active" data-group="group_21" tabindex="-1"><div><span><pre><code class="hljs css language-js"><span class="hljs-built_in">console</span>.log(<span class="hljs-string">'Hello, world!'</span>);<br /></code></pre>
|
||||
</span></div></div><div id="tab-group-21-content-23" class="tab-pane" data-group="group_21" tabindex="-1"><div><span><pre><code class="hljs css language-py">print(<span class="hljs-string">'Hello, world!'</span>)<br /></code></pre>
|
||||
</span></div></div><div id="tab-group-21-content-24" class="tab-pane" data-group="group_21" tabindex="-1"><div><span><pre><code class="hljs css language-C"><span class="hljs-meta">#<span class="hljs-meta-keyword">include</span> <span class="hljs-meta-string"><stdio.h></span></span><br /><br /><span class="hljs-function"><span class="hljs-keyword">int</span> <span class="hljs-title">main</span><span class="hljs-params">()</span> </span>{<br /> <span class="hljs-built_in">printf</span>(<span class="hljs-string">"Hello World!"</span>);<br /> <span class="hljs-keyword">return</span> <span class="hljs-number">0</span>;<br />}<br /></code></pre>
|
||||
</span></div></div><div id="tab-group-21-content-25" class="tab-pane" data-group="group_21" tabindex="-1"><div><span><pre><code class="hljs css language-Pascal"><span class="hljs-keyword">program</span> HelloWorld;<br /><span class="hljs-keyword">begin</span><br /> WriteLn(<span class="hljs-string">'Hello, world!'</span>);<br /><span class="hljs-keyword">end</span>.<br /></code></pre>
|
||||
<div class="tabs"><div class="nav-tabs"><div id="tab-group-41-tab-42" class="nav-link active" data-group="group_41" data-tab="tab-group-41-content-42">JavaScript</div><div id="tab-group-41-tab-43" class="nav-link" data-group="group_41" data-tab="tab-group-41-content-43">Python</div><div id="tab-group-41-tab-44" class="nav-link" data-group="group_41" data-tab="tab-group-41-content-44">C</div><div id="tab-group-41-tab-45" class="nav-link" data-group="group_41" data-tab="tab-group-41-content-45">Pascal</div></div><div class="tab-content"><div id="tab-group-41-content-42" class="tab-pane active" data-group="group_41" tabindex="-1"><div><span><pre><code class="hljs css language-js"><span class="hljs-built_in">console</span>.log(<span class="hljs-string">'Hello, world!'</span>);<br /></code></pre>
|
||||
</span></div></div><div id="tab-group-41-content-43" class="tab-pane" data-group="group_41" tabindex="-1"><div><span><pre><code class="hljs css language-py">print(<span class="hljs-string">'Hello, world!'</span>)<br /></code></pre>
|
||||
</span></div></div><div id="tab-group-41-content-44" class="tab-pane" data-group="group_41" tabindex="-1"><div><span><pre><code class="hljs css language-C"><span class="hljs-meta">#<span class="hljs-meta-keyword">include</span> <span class="hljs-meta-string"><stdio.h></span></span><br /><br /><span class="hljs-function"><span class="hljs-keyword">int</span> <span class="hljs-title">main</span><span class="hljs-params">()</span> </span>{<br /> <span class="hljs-built_in">printf</span>(<span class="hljs-string">"Hello World!"</span>);<br /> <span class="hljs-keyword">return</span> <span class="hljs-number">0</span>;<br />}<br /></code></pre>
|
||||
</span></div></div><div id="tab-group-41-content-45" class="tab-pane" data-group="group_41" tabindex="-1"><div><span><pre><code class="hljs css language-Pascal"><span class="hljs-keyword">program</span> HelloWorld;<br /><span class="hljs-keyword">begin</span><br /> WriteLn(<span class="hljs-string">'Hello, world!'</span>);<br /><span class="hljs-keyword">end</span>.<br /></code></pre>
|
||||
</span></div></div></div></div>
|
||||
<h2><a class="anchor" aria-hidden="true" id="syntax-highlighting"></a><a href="#syntax-highlighting" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Syntax Highlighting</h2>
|
||||
<p>Syntax highlighting is enabled by default on fenced code blocks. The language should be detected automatically, but you can sometimes get better results by specifying the language. You can do so using an <a href="https://github.github.com/gfm/#example-111">info string</a>, following the three opening backticks. The following JavaScript example...</p>
|
||||
|
|
|
@ -165,14 +165,14 @@
|
|||
<p>You can run the command above any time you update the docs and wish to deploy the changes to your site. Running the script manually may be fine for sites where the documentation rarely changes and it is not too much of an inconvenience to remember to manually deploy changes.</p>
|
||||
<p>However, you can automate the publishing process with continuous integration (CI).</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="automating-deployments-using-continuous-integration"></a><a href="#automating-deployments-using-continuous-integration" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Automating Deployments Using Continuous Integration</h2>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">Circle CI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circle-ci-20"></a><a href="#using-circle-ci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using Circle CI 2.0</h3>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">CircleCI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circleci-20"></a><a href="#using-circleci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using CircleCI 2.0</h3>
|
||||
<p>If you haven't done so already, you can <a href="https://circleci.com/signup/">setup CircleCI</a> for your open source project. Afterwards, in order to enable automatic deployment of your site and documentation via CircleCI, just configure Circle to run the <code>publish-gh-pages</code> script as part of the deployment step. You can follow the steps below to get that setup.</p>
|
||||
<ol>
|
||||
<li>Ensure the GitHub account that will be set as the <code>GIT_USER</code> has <code>write</code> access to the repository that contains the documentation, by checking <code>Settings | Collaborators & teams</code> in the repository.</li>
|
||||
<li>Log into GitHub as the <code>GIT_USER</code>.</li>
|
||||
<li>Go to <a href="https://github.com/settings/tokens">https://github.com/settings/tokens</a> for the <code>GIT_USER</code> and generate a new <a href="https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/">personal access token</a>, granting it full control of private repositories through the <code>repository</code> 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.</li>
|
||||
<li>Open your Circle CI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub organization/repository.</li>
|
||||
<li>Open your CircleCI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub organization/repository.</li>
|
||||
<li>Create a new environment variable named <code>GITHUB_TOKEN</code>, using your newly generated access token as the value.</li>
|
||||
<li>Create a <code>.circleci</code> directory and create a <code>config.yml</code> under that directory.</li>
|
||||
<li>Copy the text below into <code>.circleci/config.yml</code>.</li>
|
||||
|
@ -220,10 +220,10 @@
|
|||
</blockquote>
|
||||
<p>Now, whenever a new commit lands in <code>master</code>, CircleCI will run your suite of tests and, if everything passes, your website will be deployed via the <code>publish-gh-pages</code> script.</p>
|
||||
<blockquote>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the Circle CI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the CircleCI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
</blockquote>
|
||||
<h3><a class="anchor" aria-hidden="true" id="tips-tricks"></a><a href="#tips-tricks" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Tips & Tricks</h3>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using Circle CI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> branch fail to run successfully due to a lack of tests (This can also result in chat/slack build failure notifications).</p>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using CircleCI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> branch fail to run successfully due to a lack of tests (This can also result in chat/slack build failure notifications).</p>
|
||||
<p>You can work around this easily by:</p>
|
||||
<ul>
|
||||
<li>Setting the environment variable <code>CUSTOM_COMMIT_MESSAGE</code> flag to the <code>publish-gh-pages</code> command with the contents of <code>[skip ci]</code>.
|
||||
|
@ -233,9 +233,9 @@ e.g.</li>
|
|||
yarn run publish-gh-pages <span class="hljs-comment"># or `npm run publish-gh-pages`</span>
|
||||
</code></pre>
|
||||
<ul>
|
||||
<li>Alternatively you can work around this by creating a basic Circle CI config with the following contents:</li>
|
||||
<li>Alternatively you can work around this by creating a basic CircleCI config with the following contents:</li>
|
||||
</ul>
|
||||
<pre><code class="hljs css language-yaml"><span class="hljs-comment"># Circle CI 2.0 Config File</span>
|
||||
<pre><code class="hljs css language-yaml"><span class="hljs-comment"># CircleCI 2.0 Config File</span>
|
||||
<span class="hljs-comment"># This config file will prevent tests from being run on the gh-pages branch.</span>
|
||||
<span class="hljs-attr">version:</span> <span class="hljs-number">2</span>
|
||||
<span class="hljs-attr">jobs:</span>
|
||||
|
@ -296,7 +296,7 @@ e.g.</li>
|
|||
</tbody>
|
||||
</table>
|
||||
<p>Alter your <code>siteConfig.js</code> to add a property <code>'githubHost'</code> which represents the GitHub Enterprise hostname. Alternatively, set an environment variable <code>GITHUB_HOST</code> when executing the publish command.</p>
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-1-18 by Marvin Chin</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.7.0/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.7.0/docker"><span>Docker</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#hosting-on-a-service">Hosting on a Service:</a></li><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circle-ci-20">Using Circle CI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li><li><a href="#using-travis-ci">Using Travis CI</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li><li><a href="#publishing-to-github-enterprise">Publishing to GitHub Enterprise</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-3-27 by Yangshun Tay</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/1.7.0/site-creation"><span class="arrow-prev">← </span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/1.7.0/docker"><span>Docker</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#hosting-on-a-service">Hosting on a Service:</a></li><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circleci-20">Using CircleCI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li><li><a href="#using-travis-ci">Using Travis CI</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li><li><a href="#publishing-to-github-enterprise">Publishing to GitHub Enterprise</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div class="footerSection"><h5>Docs</h5><a href="
|
||||
/docs/en/installation">Getting Started</a><a href="
|
||||
/docs/en/versioning">Versioning</a><a href="
|
||||
/docs/en/translation">Localization</a><a href="
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue