Deployment

The website is hosted through a DigitalOcean droplet. It's configured with the production environment variables and uses forever to automatically recover from failures.

Deploying local changes via script

The live website mirrors the main branch on GitHub. Deployments have to be done manually via deploy.sharrow-up-right

Make sure to be on the main branch before running the script.

The deployment script does the following:

  1. Make sure that the server and client build correctly

  2. Run all the tests, stop if any test fails.

    The script will assume you have ".env-test" in "CovEducation/packages/server"

  3. Commit all local changes and push them to GitHub.

  4. SSH into the droplet

  5. Update the droplet's local repository

  6. Take down the website while rebuilding

  7. Rebuild both the client and server

  8. Restart the website via forever

# Assuming all relevant changes where done on main. 
$ chmod +x deploy.sh # Only on first run.
$ ./deploy.sh
Deployment tool v1
Describe the changes in this deployment:
> Caught some bugs
...
New version successfully deployed!
Total downtime: 0 minutes 5 seconds
circle-exclamation

Deploying changes manually

If you only want to sync the droplet with the main branch, you can run the following:

Last updated