grassrootsgrocery / admin-portal

GNU Affero General Public License v3.0
10 stars 5 forks source link

Change live app to point to 'main' branch instead of 'production' #60

Closed mattsahn closed 1 year ago

mattsahn commented 1 year ago

I'm going to change the Railway deployment to point to 'main' branch instead of 'production'. I think this will be a more efficient and simpler approach while preserving some of the rationale for the original 'production' branch:

  1. Since we're using Railway for hosting, we can use the auto-deploy PR branches feature. This only works for the same branch that the live deployment is pointing to. So, currently PRs to 'main' won't trigger an auto-deploy. That's not helpful since we review the code for PRs to 'main'.
  2. The utility of 'production' branch as a means of isolating the live deployment from latest changes to 'main' is not high. The goal of the second branch was to allow for code commits to main to not always be reflected immediately in the app and allow for "staging" of changes and deploying to live site on a separate schedule. However, this creates added complexity and work to do the second merge to 'production' for little benefit. With Railway's auto-deploy of PR branches, that gives us the ability to view the actual new code in a live app (separate from the production URL) prior to merging to main.
  3. Pointing the live prod URL to 'main' gets us to "continuous deployment" model which is fastest velocity where all approved/merged code is immediately reflected in the app. Failures would be unlikely as long as we check the PR branch deployed app as part of code review. Any failures could be handled by the person who did the actual merge as they will see that immediately.

Tagging @jasoncavanaugh / @hgreenhut / @zuechai for awareness

mattsahn commented 1 year ago

This is complete and working as expected.