Deploy website

Deploy website version based on 6637e1dc82
This commit is contained in:
Website Deployment Script 2020-10-05 11:19:33 +00:00
parent 51b1db8542
commit 04e2ae2fcc
42 changed files with 1344 additions and 42 deletions

View file

@ -335,6 +335,37 @@
<span class="hljs-attr">GH_TOKEN:</span> <span class="hljs-string">$(GH_TOKEN)</span>
<span class="hljs-attr">displayName:</span> <span class="hljs-string">'yarn install and build'</span>
</code></pre>
<h3><a class="anchor" aria-hidden="true" id="using-drone"></a><a href="#using-drone" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 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 Drone</h3>
<ol>
<li>Create a new ssh key that will be the <a href="https://docs.github.com/en/free-pro-team@latest/developers/overview/managing-deploy-keys#deploy-keys">deploy key</a> for your project.</li>
<li>Name your private and public keys to be specific and so that it does not overwrite your other <a href="https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent">ssh keys</a>.</li>
<li>Go to <a href="https://github.com/USERNAME/REPO/settings/keys">https://github.com/USERNAME/REPO/settings/keys</a> and add a new deploy key by pasting in our public key you just generated.</li>
<li>Open your <a href="http://Drone.io">Drone.io</a> dashboard and login. The URL looks like <a href="https://cloud.drone.io/USERNAME/REPO">https://cloud.drone.io/USERNAME/REPO</a>.</li>
<li>Click on the repository, click on activate repository, and add a secret called <code>git_deploy_private_key</code> with your private key value that you just generated.</li>
<li>Create a <code>.drone.yml</code> on the root of your repository with below text.</li>
</ol>
<pre><code class="hljs css language-yaml"><span class="hljs-comment"># .drone.yml</span>
<span class="hljs-attr">kind:</span> <span class="hljs-string">pipeline</span>
<span class="hljs-attr">type:</span> <span class="hljs-string">docker</span>
<span class="hljs-attr">trigger:</span>
<span class="hljs-attr">event:</span>
<span class="hljs-bullet">-</span> <span class="hljs-string">tag</span>
<span class="hljs-bullet">-</span> <span class="hljs-attr">name:</span> <span class="hljs-string">Website</span>
<span class="hljs-attr">image:</span> <span class="hljs-string">node</span>
<span class="hljs-attr">commands:</span>
<span class="hljs-bullet">-</span> <span class="hljs-string">mkdir</span> <span class="hljs-string">-p</span> <span class="hljs-string">$HOME/.ssh</span>
<span class="hljs-bullet">-</span> <span class="hljs-string">ssh-keyscan</span> <span class="hljs-string">-t</span> <span class="hljs-string">rsa</span> <span class="hljs-string">github.com</span> <span class="hljs-string">&gt;&gt;</span> <span class="hljs-string">$HOME/.ssh/known_hosts</span>
<span class="hljs-bullet">-</span> <span class="hljs-string">echo</span> <span class="hljs-string">"$GITHUB_PRIVATE_KEY &gt; $HOME/.ssh/id_rsa"</span>
<span class="hljs-bullet">-</span> <span class="hljs-string">chmod</span> <span class="hljs-number">0600</span> <span class="hljs-string">$HOME/.ssh/id_rsa</span>
<span class="hljs-bullet">-</span> <span class="hljs-string">cd</span> <span class="hljs-string">website</span>
<span class="hljs-bullet">-</span> <span class="hljs-string">npm</span> <span class="hljs-string">i</span>
<span class="hljs-bullet">-</span> <span class="hljs-string">npm</span> <span class="hljs-string">run</span> <span class="hljs-string">publish-gh-pages</span>
<span class="hljs-attr">environment:</span>
<span class="hljs-attr">USE_SSH:</span> <span class="hljs-literal">true</span>
<span class="hljs-attr">GIT_USER:</span> <span class="hljs-string">$DRONE_COMMIT_AUTHOR</span>
<span class="hljs-attr">GITHUB_PRIVATE_KEY:</span> <span class="hljs-string">git_deploy_private_key</span>
</code></pre>
<p>Now, whenever you push a new tag to github, this trigger will start the drone ci job to publish your website.</p>
<h3><a class="anchor" aria-hidden="true" id="hosting-on-vercel"></a><a href="#hosting-on-vercel" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 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 on Vercel</h3>
<p>Deploying your Docusaurus project to <a href="https://vercel.com/">Vercel</a> will provide you with <a href="https://vercel.com/">various benefits</a> in the areas of performance and ease of use.</p>
<p>To deploy your Docusaurus project with a <a href="https://vercel.com/docs/git-integrations">Vercel for Git Integration</a>, make sure it has been pushed to a Git repository.</p>
@ -389,7 +420,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 9/2/2020 by Sam Ko</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/next/site-creation"><span class="arrow-prev"></span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/next/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-vercel">Using Vercel</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 &amp; Tricks</a></li><li><a href="#using-travis-ci">Using Travis CI</a></li><li><a href="#using-azure-pipelines">Using Azure Pipelines</a></li><li><a href="#hosting-on-vercel">Hosting on Vercel</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li><li><a href="#hosting-on-render">Hosting on Render</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 10/5/2020 by aakhtar3</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/next/site-creation"><span class="arrow-prev"></span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/next/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-vercel">Using Vercel</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 &amp; Tricks</a></li><li><a href="#using-travis-ci">Using Travis CI</a></li><li><a href="#using-azure-pipelines">Using Azure Pipelines</a></li><li><a href="#using-drone">Using Drone</a></li><li><a href="#hosting-on-vercel">Hosting on Vercel</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li><li><a href="#hosting-on-render">Hosting on Render</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="

View file

@ -335,6 +335,37 @@
<span class="hljs-attr">GH_TOKEN:</span> <span class="hljs-string">$(GH_TOKEN)</span>
<span class="hljs-attr">displayName:</span> <span class="hljs-string">'yarn install and build'</span>
</code></pre>
<h3><a class="anchor" aria-hidden="true" id="using-drone"></a><a href="#using-drone" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 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 Drone</h3>
<ol>
<li>Create a new ssh key that will be the <a href="https://docs.github.com/en/free-pro-team@latest/developers/overview/managing-deploy-keys#deploy-keys">deploy key</a> for your project.</li>
<li>Name your private and public keys to be specific and so that it does not overwrite your other <a href="https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent">ssh keys</a>.</li>
<li>Go to <a href="https://github.com/USERNAME/REPO/settings/keys">https://github.com/USERNAME/REPO/settings/keys</a> and add a new deploy key by pasting in our public key you just generated.</li>
<li>Open your <a href="http://Drone.io">Drone.io</a> dashboard and login. The URL looks like <a href="https://cloud.drone.io/USERNAME/REPO">https://cloud.drone.io/USERNAME/REPO</a>.</li>
<li>Click on the repository, click on activate repository, and add a secret called <code>git_deploy_private_key</code> with your private key value that you just generated.</li>
<li>Create a <code>.drone.yml</code> on the root of your repository with below text.</li>
</ol>
<pre><code class="hljs css language-yaml"><span class="hljs-comment"># .drone.yml</span>
<span class="hljs-attr">kind:</span> <span class="hljs-string">pipeline</span>
<span class="hljs-attr">type:</span> <span class="hljs-string">docker</span>
<span class="hljs-attr">trigger:</span>
<span class="hljs-attr">event:</span>
<span class="hljs-bullet">-</span> <span class="hljs-string">tag</span>
<span class="hljs-bullet">-</span> <span class="hljs-attr">name:</span> <span class="hljs-string">Website</span>
<span class="hljs-attr">image:</span> <span class="hljs-string">node</span>
<span class="hljs-attr">commands:</span>
<span class="hljs-bullet">-</span> <span class="hljs-string">mkdir</span> <span class="hljs-string">-p</span> <span class="hljs-string">$HOME/.ssh</span>
<span class="hljs-bullet">-</span> <span class="hljs-string">ssh-keyscan</span> <span class="hljs-string">-t</span> <span class="hljs-string">rsa</span> <span class="hljs-string">github.com</span> <span class="hljs-string">&gt;&gt;</span> <span class="hljs-string">$HOME/.ssh/known_hosts</span>
<span class="hljs-bullet">-</span> <span class="hljs-string">echo</span> <span class="hljs-string">"$GITHUB_PRIVATE_KEY &gt; $HOME/.ssh/id_rsa"</span>
<span class="hljs-bullet">-</span> <span class="hljs-string">chmod</span> <span class="hljs-number">0600</span> <span class="hljs-string">$HOME/.ssh/id_rsa</span>
<span class="hljs-bullet">-</span> <span class="hljs-string">cd</span> <span class="hljs-string">website</span>
<span class="hljs-bullet">-</span> <span class="hljs-string">npm</span> <span class="hljs-string">i</span>
<span class="hljs-bullet">-</span> <span class="hljs-string">npm</span> <span class="hljs-string">run</span> <span class="hljs-string">publish-gh-pages</span>
<span class="hljs-attr">environment:</span>
<span class="hljs-attr">USE_SSH:</span> <span class="hljs-literal">true</span>
<span class="hljs-attr">GIT_USER:</span> <span class="hljs-string">$DRONE_COMMIT_AUTHOR</span>
<span class="hljs-attr">GITHUB_PRIVATE_KEY:</span> <span class="hljs-string">git_deploy_private_key</span>
</code></pre>
<p>Now, whenever you push a new tag to github, this trigger will start the drone ci job to publish your website.</p>
<h3><a class="anchor" aria-hidden="true" id="hosting-on-vercel"></a><a href="#hosting-on-vercel" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 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 on Vercel</h3>
<p>Deploying your Docusaurus project to <a href="https://vercel.com/">Vercel</a> will provide you with <a href="https://vercel.com/">various benefits</a> in the areas of performance and ease of use.</p>
<p>To deploy your Docusaurus project with a <a href="https://vercel.com/docs/git-integrations">Vercel for Git Integration</a>, make sure it has been pushed to a Git repository.</p>
@ -389,7 +420,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 9/2/2020 by Sam Ko</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/next/site-creation"><span class="arrow-prev"></span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/next/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-vercel">Using Vercel</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 &amp; Tricks</a></li><li><a href="#using-travis-ci">Using Travis CI</a></li><li><a href="#using-azure-pipelines">Using Azure Pipelines</a></li><li><a href="#hosting-on-vercel">Hosting on Vercel</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li><li><a href="#hosting-on-render">Hosting on Render</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 10/5/2020 by aakhtar3</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/next/site-creation"><span class="arrow-prev"></span><span>Creating your site</span></a><a class="docs-next button" href="/docs/en/next/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-vercel">Using Vercel</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 &amp; Tricks</a></li><li><a href="#using-travis-ci">Using Travis CI</a></li><li><a href="#using-azure-pipelines">Using Azure Pipelines</a></li><li><a href="#using-drone">Using Drone</a></li><li><a href="#hosting-on-vercel">Hosting on Vercel</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li><li><a href="#hosting-on-render">Hosting on Render</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="