From 4abce110f62c6cf5878543c4d1087b51b8c31d64 Mon Sep 17 00:00:00 2001 From: Leandro Facchinetti Date: Sat, 21 Mar 2020 12:53:17 -0400 Subject: [PATCH] . --- README.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/README.md b/README.md index acc0587..3f2ed92 100644 --- a/README.md +++ b/README.md @@ -22,3 +22,33 @@ $ npm start ``` The web server will be running at `http://localhost:8000` and the email server at `smtp://localhost:2525`. + +# Deployment + +1. Create a deployment SSH key pair: + + ```console + $ ssh-keygen + ``` + +2. Add the public key (`id_rsa.pub`) to DigitalOcean and to GitHub as a **Deploy key** for the repository. + +3. Add the private key (`id_rsa`) to GitHub as a **Secret** called `SSH_PRIVATE_KEY`. + +4. Create a DigitalOcean droplet. + +5. Configure DNS: + + | Type | Host | Value | + | ------- | ----- | ------------------------- | + | `A` | `@` | `` | + | `CNAME` | `www` | `kill-the-newsletter.com` | + | `MX` | `@` | `kill-the-newsletter.com` | + +6. Setup the server: + + ```console + $ npx pm2 deploy package.json production setup + ``` + +7. Push to GitHub, which will trigger the Action that deploys the code and starts the server.