Deploy website

Deploy website version based on e58e31a230
This commit is contained in:
Website Deployment Script 2018-04-14 20:09:07 +00:00
parent e58e31a230
commit 6bd08f7412
3 changed files with 60 additions and 26 deletions

View file

@ -21,7 +21,7 @@
</code></pre>
<p>This will generate a <code>build</code> folder inside the <code>website</code> directory containing the <code>.html</code> files from all of your docs and other pages included in <code>pages</code>.</p>
<h2><a class="anchor" aria-hidden="true" id="hosting-static-html-pages"></a><a href="#hosting-static-html-pages" aria-hidden="true" class="hash-link" ><svg aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Hosting Static HTML Pages</h2>
<p>At this point, you can grab all of the files inside the <code>website/build</code> folder and copy them over to your favorite web server's &quot;html&quot; directory.</p>
<p>At this point, you can grab all of the files inside the <code>website/build</code> folder and copy them over to your favorite web server's <code>html</code> directory.</p>
<blockquote>
<p>For example, both Apache and nginx serve content from <code>/var/www/html</code> by default. That said, choosing a web server or provider is outside the scope of Docusaurus.</p>
</blockquote>
@ -33,10 +33,15 @@
</blockquote>
<p>Most of the work to publish to GitHub pages is done for you automatically through the <a href="/docs/en/next/Comandos.html#docusaurus-publish"><code>publish-gh-pages</code></a> script. You just need to determine the values for a few parameters required by the script.</p>
<p>Two of the required parameters are set in the [<code>siteConfig.js</code>](/docs/en/next/configuración del sitio.html):</p>
<ul>
<li><code>organizationName</code>: The GitHub user or organization that owns the repository. In the case of Docusaurus, that would be the &quot;facebook&quot; GitHub organization.</li>
<li><code>projectName</code>: The name of the GitHub repository for your project. For example, Docusaurus is hosted at <a href="https://github.com/facebook/docusaurus">https://github.com/facebook/docusaurus</a>, so our project name in this case would be &quot;docusaurus&quot;.</li>
</ul>
<table>
<thead>
<tr><th>Name</th><th>Description</th></tr>
</thead>
<tbody>
<tr><td><code>organizationName</code></td><td>The GitHub user or organization that owns the repository. In the case of Docusaurus, that would be the &quot;facebook&quot; GitHub organization.</td></tr>
<tr><td><code>projectName</code></td><td>The name of the GitHub repository for your project. For example, Docusaurus is hosted at <a href="https://github.com/facebook/docusaurus">https://github.com/facebook/docusaurus</a>, so our project name in this case would be &quot;docusaurus&quot;.</td></tr>
</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>. These sites will be served from the <code>master</code> branch of the repo. So, you will want to have the Docusaurus infra, your docs, etc. in another branch (e.g., maybe call it <code>source</code>). To do this, just set <code>projectName</code> to &quot;<em>username</em>.github.io&quot; (where <em>username</em> is your username or organization name on GitHub) and <code>organizationName</code> to &quot;<em>username</em>&quot;. The publish script will automatically deploy your site to the root of the <code>master</code> branch to be served.</p>
</blockquote>
@ -44,14 +49,24 @@
<p>While we recommend setting the <code>projectName</code> and <code>organizationName</code> in <code>siteConfig.js</code>, you can also use environment variables <code>ORGANIZATION_NAME</code> and <code>PROJECT_NAME</code>.</p>
</blockquote>
<p>One of the required parameters is set as a environment variable:</p>
<ul>
<li><code>GIT_USER</code>: The username for a GitHub account that has commit access to this repo. For your own repositories, this will usually be your own GitHub username.</li>
</ul>
<table>
<thead>
<tr><th>Name</th><th>Description</th></tr>
</thead>
<tbody>
<tr><td><code>GIT_USER</code></td><td>The username for a GitHub account that has commit access to this repo. For your own repositories, this will usually be your own GitHub username.</td></tr>
</tbody>
</table>
<p>There are also two optional parameters that are set as environment variables:</p>
<ul>
<li><p><code>USE_SSH</code>: If this is set to <code>true</code>, then SSH is used instead of HTTPS for the connection to the GitHub repo. HTTPS is the default if this variable is not set.</p></li>
<li><p><code>CURRENT_BRANCH</code>: The branch that contains the latest docs changes that will be deployed. Usually, the branch will be <code>master</code>, but it could be any branch (default or otherwise) except for <code>gh-pages</code>. If nothing is set for this variable, then the current branch will be used.</p></li>
</ul>
<table>
<thead>
<tr><th>Name</th><th>Description</th></tr>
</thead>
<tbody>
<tr><td><code>USE_SSH</code></td><td>If this is set to <code>true</code>, then SSH is used instead of HTTPS for the connection to the GitHub repo. HTTPS is the default if this variable is not set.</td></tr>
<tr><td><code>CURRENT_BRANCH</code></td><td>The branch that contains the latest docs changes that will be deployed. Usually, the branch will be <code>master</code>, but it could be any branch (default or otherwise) except for <code>gh-pages</code>. If nothing is set for this variable, then the current branch will be used.</td></tr>
</tbody>
</table>
<p>Once you have the parameter value information, you can go ahead and run the publish script, ensuring you have inserted your own values inside the various parameter placeholders:</p>
<p>To run the script directly from the command-line, you can use the following, filling in the parameter values as appropriate.</p>
<pre><code class="hljs css bash">GIT_USER=&lt;GIT_USER&gt; \
@ -109,7 +124,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>&lt;....&gt;</code> in the <code>command:</code> sequence with appropriate values. For <code>&lt;GIT_USER&gt;</code>, it should be a GitHub account that has access to push documentation to your GitHub repo. Many times <code>&lt;GIT_USER&gt;</code> and <code>&lt;GITHUB_USERNAME&gt;</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>

View file

@ -21,7 +21,7 @@
</code></pre>
<p>This will generate a <code>build</code> folder inside the <code>website</code> directory containing the <code>.html</code> files from all of your docs and other pages included in <code>pages</code>.</p>
<h2><a class="anchor" aria-hidden="true" id="hosting-static-html-pages"></a><a href="#hosting-static-html-pages" aria-hidden="true" class="hash-link" ><svg aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Hosting Static HTML Pages</h2>
<p>At this point, you can grab all of the files inside the <code>website/build</code> folder and copy them over to your favorite web server's &quot;html&quot; directory.</p>
<p>At this point, you can grab all of the files inside the <code>website/build</code> folder and copy them over to your favorite web server's <code>html</code> directory.</p>
<blockquote>
<p>For example, both Apache and nginx serve content from <code>/var/www/html</code> by default. That said, choosing a web server or provider is outside the scope of Docusaurus.</p>
</blockquote>
@ -33,23 +33,38 @@
</blockquote>
<p>Most of the work to publish to GitHub pages is done for you automatically through the <a href="/docs/es-ES/next/Comandos.html#docusaurus-publish"><code>publish-gh-pages</code></a> script. You just need to determine the values for a few parameters required by the script.</p>
<p>Two of the required parameters are set in the [<code>siteConfig.js</code>](/docs/es-ES/next/configuración del sitio.html):</p>
<ul>
<li><code>organizationName</code>: The GitHub user or organization that owns the repository. In the case of Docusaurus, that would be the &quot;facebook&quot; GitHub organization.</li>
<li><code>projectName</code>: The name of the GitHub repository for your project. For example, Docusaurus is hosted at <a href="https://github.com/facebook/docusaurus">https://github.com/facebook/docusaurus</a>, so our project name in this case would be &quot;docusaurus&quot;.</li>
</ul>
<table>
<thead>
<tr><th>Name</th><th>Description</th></tr>
</thead>
<tbody>
<tr><td><code>organizationName</code></td><td>The GitHub user or organization that owns the repository. In the case of Docusaurus, that would be the &quot;facebook&quot; GitHub organization.</td></tr>
<tr><td><code>projectName</code></td><td>The name of the GitHub repository for your project. For example, Docusaurus is hosted at <a href="https://github.com/facebook/docusaurus">https://github.com/facebook/docusaurus</a>, so our project name in this case would be &quot;docusaurus&quot;.</td></tr>
</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>. These sites will be served from the <code>master</code> branch of the repo. So, you will want to have the Docusaurus infra, your docs, etc. in another branch (e.g., maybe call it <code>source</code>). To do this, just set <code>projectName</code> to &quot;<em>username</em>.github.io&quot; (where <em>username</em> is your username or organization name on GitHub) and <code>organizationName</code> to &quot;<em>username</em>&quot;. The publish script will automatically deploy your site to the root of the <code>master</code> branch to be served.</p>
<p>While we recommend setting the <code>projectName</code> and <code>organizationName</code> in <code>siteConfig.js</code>, you can also use environment variables <code>ORGANIZATION_NAME</code> and <code>PROJECT_NAME</code>.</p>
</blockquote>
<p>One of the required parameters is set as a environment variable:</p>
<ul>
<li><code>GIT_USER</code>: The username for a GitHub account that has commit access to this repo. For your own repositories, this will usually be your own GitHub username.</li>
</ul>
<table>
<thead>
<tr><th>Name</th><th>Description</th></tr>
</thead>
<tbody>
<tr><td><code>GIT_USER</code></td><td>The username for a GitHub account that has commit access to this repo. For your own repositories, this will usually be your own GitHub username.</td></tr>
</tbody>
</table>
<p>There are also two optional parameters that are set as environment variables:</p>
<ul>
<li><p><code>USE_SSH</code>: If this is set to <code>true</code>, then SSH is used instead of HTTPS for the connection to the GitHub repo. HTTPS is the default if this variable is not set.</p></li>
<li><p><code>CURRENT_BRANCH</code>: The branch that contains the latest docs changes that will be deployed. Usually, the branch will be <code>master</code>, but it could be any branch (default or otherwise) except for <code>gh-pages</code>. If nothing is set for this variable, then the current branch will be used.</p></li>
</ul>
<table>
<thead>
<tr><th>Name</th><th>Description</th></tr>
</thead>
<tbody>
<tr><td><code>USE_SSH</code></td><td>If this is set to <code>true</code>, then SSH is used instead of HTTPS for the connection to the GitHub repo. HTTPS is the default if this variable is not set.</td></tr>
<tr><td><code>CURRENT_BRANCH</code></td><td>The branch that contains the latest docs changes that will be deployed. Usually, the branch will be <code>master</code>, but it could be any branch (default or otherwise) except for <code>gh-pages</code>. If nothing is set for this variable, then the current branch will be used.</td></tr>
</tbody>
</table>
<p>Once you have the parameter value information, you can go ahead and run the publish script, ensuring you have inserted your own values inside the various parameter placeholders:</p>
<p>To run the script directly from the command-line, you can use the following, filling in the parameter values as appropriate.</p>
<pre><code class="hljs css bash">GIT_USER=&lt;GIT_USER&gt; \
@ -107,7 +122,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>&lt;....&gt;</code> in the <code>command:</code> sequence with appropriate values. For <code>&lt;GIT_USER&gt;</code>, it should be a GitHub account that has access to push documentation to your GitHub repo. Many times <code>&lt;GIT_USER&gt;</code> and <code>&lt;GITHUB_USERNAME&gt;</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>