Skip to content

Commit

Permalink
Add more detailed guidance about GitHub
Browse files Browse the repository at this point in the history
  • Loading branch information
vickytnz committed Dec 18, 2024
1 parent 2d3b917 commit d0a8f54
Showing 1 changed file with 24 additions and 12 deletions.
36 changes: 24 additions & 12 deletions app/views/how-tos/publish-your-prototype-online.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,34 +22,46 @@ <h1>Publish your prototype online</h1>
<p>You'll need a hosting service to publish prototypes online.</p>

<h2>Hosting services</h2>
<p>The NHS prototype kit runs on any hosting service that supports Node.js.</p>
<p>The NHS prototype kit runs on any hosting service that supports Node.js. This means it does not run on 'static' hosting services like GitHub Pages or Netlify.</p>
<p>Your organisation may already use a hosting service for the prototype kit. Check with your digital team about which platform to use.</p>
<p>For example:</p>
<h3>If you are using GitHub to store your code online</h3>
<p>Many hosting services automatically deploy your prototype every time you merge new changes in the connected GitHub repository. Usually you can enable automatic deploys.</p>
<p>This includes:</p>
<ul>
<li>Heroku (requires payment) – see <a href="https://devcenter.heroku.com/articles/github-integration">GitHub integration on Heroku website</a></li>
<li>Railway – see <a href="https://railway.app/new/github">Deploy repository on Railway website</a></li>
<li><a href="https://devcenter.heroku.com/articles/github-integration">Heroku (GitHub Integration)</a></li>
<li><a href="https://railway.app/new/github">Railway (deploy repository)</a></li>
</ul>
<p>In Railway, you need to set the command to get started. Go to Settings > Deploy and set it to <code class="app-code">npm run start</code>.</p>
<p>Some hosting services may automatically deploy your prototype every time you merge new changes in the connected GitHub repository. You may be able to enable automatic deploys. If it hasn't automatically updated your prototype, you will need to do this manually.</p>
<h3>Other ways to get your code onto a hosting service</h3>
<p>Usually you can connect your code using Git. Use our <a href="git">Git guide</a> and then instructions from your hosting service (for example, <a href="https://devcenter.heroku.com/articles/git">Heroku</a> or <a href="https://docs.railway.com/guides/cli">Railway</a>). </p>


<h2>Setting a password</h2>
<p>When running the prototype kit online, you must set a password. This is to stop anyone accidentally finding your prototype and mistaking it for a real service.</p>
<p>To set a password, check your hosting services documentation on how to set "environment variables". (It may have a slightly different name like "config vars" or "variables".)</p>
<p>The password should be set using the variable <code class="app-code">PROTOTYPE_PASSWORD</code>.</p>

<p>If you are using an older version of the prototype kit (before v4.12.0) you will also need to set a username using the variable <code class="app-code">PROTOTYPE_USERNAME</code>.</p>

<p>In Railway, you also need to create:</p>
<p>Read more about environment variables for:</p>
<ul>
<li>a variable called <code class="app-code">NODE-ENV</code> and set the value to <code class="app-code">production</code></li>
<li>a variable called <code class="app-code">USE_AUTH</code> with the value of <code class="app-code">true</code></li>
<li><a href="https://catalins.tech/heroku-environment-variables/">Heroku, on the Catalin's Tech website</a></li>
<li><a href="https://docs.railway.app/develop/variables">Railway</a></li>
</ul>

<p>Read more about:</p>
<h2>If Railway is your hosting service</h2>

<p>You need to do some extra things to run your prototype online using Railway.</p>


<p>Add 2 more environment variables:</p>
<ul>
<li><a href="https://catalins.tech/heroku-environment-variables/">How to set environment variables on Heroku, on the Catalin's Tech website</a></li>
<li><a href="https://docs.railway.app/develop/variables">Variables, on Railway's website</a></li>
<li>a variable called <code class="app-code">NODE-ENV</code> and set the value to <code class="app-code">production</code></li>
<li>a variable called <code class="app-code">USE_AUTH</code> with the value of <code class="app-code">true</code></li>
</ul>

<p>You also need to set the command to get started. Go to Settings > Deploy and set it to <code class="app-code">npm run start</code>.</p>


</div>

</div>
Expand Down

0 comments on commit d0a8f54

Please sign in to comment.