Deploy website

Deploy website version based on 3f83797433
This commit is contained in:
Website Deployment Script 2018-03-08 19:46:50 +00:00
parent 3f83797433
commit cda3e8e85e

View file

@ -116,24 +116,24 @@ const translate = require("../../server/translate.js").translate;
<p>You will want to manually sync your files to and from crowdin. The sync process will upload any markdown files in <code>/docs</code> as well as translatable strings in <code>website/i18n/en.json</code>. (These strings can be generated by running <code>yarn write-translations</code>.)</p>
<p>You can add the following to your <code>package.json</code> to manually trigger crowdin.</p>
<pre><code class="hljs css json">"scripts": {
"crowdin-upload": "export CROWDIN_DOCUSAURUS_PROJECT_ID=YOUR_CROWDIN_PROJECT_ID;
export CROWDIN_DOCUSAURUS_API_KEY=YOUR_CROWDIN_API_KEY; crowdin --config ../crowdin.yaml upload sources --auto-update -b master",
"crowdin-download": "export CROWDIN_DOCUSAURUS_PROJECT_ID=YOUR_CROWDIN_PROJECT_ID;
export CROWDIN_DOCUSAURUS_API_KEY=YOUR_CROWDIN_API_KEY; crowdin --config ../crowdin.yaml download -b master"
"crowdin-upload": "crowdin --config ../crowdin.yaml upload sources --auto-update -b master",
"crowdin-download": "crowdin --config ../crowdin.yaml download -b master"
},
</code></pre>
<p>These commands require having an environment variable set with your crowdin project id and api key (<code>CROWDIN_PROJECT_ID</code>, <code>CROWDIN_API_KEY</code>). You can add them inline like above or add them permanently to your <code>.bashrc</code> or <code>.bash_profile</code>.</p>
<h3><a class="anchor" aria-hidden="true" id="manual-file-sync"></a><a href="#manual-file-sync" 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>Manual File Sync</h3>
<p>You will always want to upload your markdown files and translatable strings first and the download the translations section. So run the commands in this order:</p>
<pre><code class="hljs"><span class="hljs-attribute">CROWDIN_DOCUSAURUS_PROJECT_ID</span>=YOUR_CROWDIN_PROJECT_ID <span class="hljs-attribute">CROWDIN_DOCUSAURUS_API_KEY</span>=YOUR_CROWDIN_API_KEY yarn <span class="hljs-builtin-name">run</span> crowdin-upload
<span class="hljs-attribute">CROWDIN_DOCUSAURUS_PROJECT_ID</span>=YOUR_CROWDIN_PROJECT_ID <span class="hljs-attribute">CROWDIN_DOCUSAURUS_API_KEY</span>=YOUR_CROWDIN_API_KEY yarn <span class="hljs-builtin-name">run</span> crowdin-download
</code></pre>
<blockquote>
<p><code>YOUR_CROWDIN_PROJECT_ID</code> is the name of your Crowdin project. e.g., for <a href="https://crowdin.com/project/docusaurus/">https://crowdin.com/project/docusaurus/</a>, that variable would be set to <code>docusaurus</code>. <code>YOUR_CROWDIN_API_KEY</code> is a unique key that is like a password. You can find it in the <code>API</code> tab of your Crowdin project's <code>Settings</code>.</p>
</blockquote>
<blockquote>
<p>These commands require having an environment variable set with your crowdin project id and api key (<code>CROWDIN_PROJECT_ID</code>, <code>CROWDIN_API_KEY</code>). You can preface them inline as done above or add them permanently to your <code>.bashrc</code> or <code>.bash_profile</code>.</p>
</blockquote>
<blockquote>
<p>If you run more than one localized Docusaurus project on your computer, you should change the name of the environment variables to something unique (<code>CROWDIN_PROJECTNAME_PROJECT_ID</code>, <code>CROWDIN_PROJECTNAME_API_KEY</code>).</p>
</blockquote>
<h3><a class="anchor" aria-hidden="true" id="manual-file-sync"></a><a href="#manual-file-sync" 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>Manual File Sync</h3>
<p>You will always want to upload your markdown files and translatable strings first and the download the translations section. So run the commands in this order:</p>
<pre><code class="hljs">yarn <span class="hljs-keyword">run</span><span class="bash"> crowdin-upload
</span>yarn <span class="hljs-keyword">run</span><span class="bash"> crowdin-download
</span></code></pre>
<blockquote>
<p>Since the files are generated, you do not need to have any files in your <code>website/i18n</code> or <code>website/translated_docs</code> directory as part of your repo. So you can can add <code>website/i18n/*</code> and <code>website/translated_docs</code> to your <code>.gitignore</code> file.</p>
</blockquote>