Projects Deployed!

Very short session today.

I'll try to finish what I started yesterday. I need to create nginx configs and add symlinks to sites-enabled

This is the basic configuration I'll be using. The SSL stuff will be added by Certbot.

server {
    listen 80;
    server_name {% .Url %};

    root /{% .Slug %}/{% .App %}/static;
    index index.html;

    location / {
        try_files $uri /index.html;
    }
}

Done. The config is now generated when an app is generated and the symlink is added to nginx sites-enabled dir.

Now I have to set up the env vars on GitHub Actions. Should be pretty easy with the github lib.

Done! It was more complicated than I anticipated. The docs are recommending a terrible crypto library, but if you ignore that and use the stdlib, it's pretty straightforward.

alt text

Fixed a few more things on the actions and everything's deploying now! Within a few seconds, I generate the repos and deploy to production. Pretty cool.

The api can't start yet though, as I still haven't set up the database credentials. Guess I'll do that next.

For each app I need to:

  • create a new database
  • create a new user that will own the database
  • get the credentials, build a connection string
  • pass that into the config

Also, I still have to set up the prod keycloak 🤭

I'll leave that for another day. A very productive session!