Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more detailed guidance about GitHub #193

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading