Our new customer portal is now live!
Guides

Test changes in a Node.js staging environment

Deploy a separate Git branch to a test address before releasing changes to production.

6 min · Intermediate

Updated

In this guide

Before you start

You need a production website deployed from GitHub, management permissions and a test branch in the repository, such as develop. Staging has its own deployments, logs and environment variables.

Create staging

  1. Open the production website and Staging.
  2. Enter an existing test branch in Branch to test.
  3. Review Copy the production environment variables. Clear it if copying could trigger jobs that write to production data, make real payments or send email. Copied credentials may be used during the first startup.
  4. Select Create staging environment, then Open staging.
  5. On staging's own Environment page, configure a test database and test-service keys. Save and wait for deployment to finish.

Test and release to production

Open the staging address and test the change, login, forms and data storage. Confirm that tests write to the test database. When everything works, merge the test branch into the production branch on GitHub. Production deploys automatically if automatic deployment is enabled; otherwise select Deploy on the production website.

If staging does not work

Check the test branch name, its deployment log and required variables. Review later production variable changes in staging as well. Having a separate test URL does not itself protect its contents with a login, so implement the necessary access controls in the application.