Production deployments - Vanuatu-National-Statistics-Office/vnso-nsdp-platform GitHub Wiki

Staging site vs Production site

Staging deployments

Any changes to the repository in the "develop" branch will result in a "staging deployment", which updates the content of the staging site. These types of deployments will be most common, since they happen with any change to the repository in the "develop" branch.

Production deployments

Any changes to the repository in the "master" branch will result in a "production deployment", which updates the content of the production site. These types of deployments will be less common.

Workflow for staging/production deployments

The expected workflow for these deployments might be something like this:

  1. You make a plan to have a production deployment at some future date, like 2023-01-01, for example.
  2. You make changes to the platform as needed, by merging pull-requests into the "develop" branch, as usual. This goes one for weeks/months/etc as you tweak the platform.
  3. When you are happy with the staging site and ready to "push it to production", you perform a production deployment by merging the "develop" branch into the "master branch".
  4. You go back to step 1 and begin preparing for the next production release.

Procedure for a production deployment

Here are the steps to perform a production deployment:

  1. Go to the repository.
  2. Go to the pull-request section.
  3. Click "New pull request".
  4. Open the drop-down "base: develop" and select "master".
  5. Click "Create pull request".
  6. Give it a title (eg "Production deployment 2023-01-01") and click "Create pull request".
  7. After any tests complete, click "Merge pull request".

Production-specific configuration

Normally all site configuration goes in this file. However there is a second file in which you can override any configuration option, for the production site. At the time of this writing, the contents of the file are:

analytics:
  ga_prod: ''
disclaimer:
  hidden: true
goal_image_base: /assets/img/goals
environment: production

Some notes about those options:

  • analytics: This is for Google Analytics. Presumably you may want to turn on Google Analytics on production, at some point. There is more information on this option at the Open SDG documentation.
  • disclaimer: This hidden option hides the disclaimer at the top of the page, for production.
  • goal_image_base: This needs to be here because the production site does not use a subfolder, and so the links to goal images are different than on staging.
  • environment: This should be set to production, for various functionality in the platform.