Publish your prototype
One of the ways you can deploy, or publish and share your prototype with others, is through Heroku.
Create an app on Heroku
- Log into your Heroku account
- Select on New and select Create new app
- A prototype deployed on Heroku is called an ‘app’. Type in an app name for your prototype and choose Europe as your region. Click Create app
Run the deployment generator in terminal
In terminal, run the command:
npm run create:deployment
Answer the interactive prompts
The deployment generator will ask you some questions.
- Hit the 'return' key to select Heroku as your deployment option
- Name your branch main
- Hit the 'return' key to accept the other prompts called 'secrets' asking about your email address, API key and app name
Setting up secrets in GitHub
In your GitHub Settings, select Secrets on the left hand side menu. Click the button New repository secret. This is where you'll be entering the secrets you accepted in your deployment generator.
Each secret is made up of a name and value. Enter the names as displayed below with the relevant values.
|HEROKU_EMAIL||This will be your Heroku email address|
|HEROKU_APP_NAME||This will be the app name for your prototype; for example, review-licence-applications|
|HEROKU_API_KEY||You can find this by going into your Account settings page in Heroku. Find the section on API Key and click Reveal.|
Push your new deployment on Heroku
In terminal, run these commands:
git add .- locally stages your files ready to be committed
git commit -m "add deployment pipeline"- locally commits your files
git push- publishes your files on GitHub
This will build your prototype in Heroku and may take a few minutes. Once that is done, click on the Open app tab in Heroku to view your prototype. It will have a url like review-licence-applications.herokuapp.com which you can share with others.
Set a username and password
After you’ve completed the last step to deploy your application, you must protect your prototype and make it secure. To do this:
- click on the Settings tab on Heroku
- under Config Vars, click on Reveal Config Vars
- enter your username and password details