A simple and efficient way to deploy the instances from different branches in the same Github repo

In my development process, I frequently need to deploy instances from multiple branches within the same GitHub repository. However, I encounter a challenge when trying to switch between branches during deployment. Here's the typical scenario:

  1. I initially deploy an instance from the main branch, and since there are numerous environment variables configured, I want to avoid creating separate instances for each branch.

  2. To switch to a different branch, I disconnect the repository and then reconnect it, selecting the new branch.

  3. Despite selecting the new branch and initiating a deployment, the system often defaults to deploying from the original main branch instead of the newly selected one.

This workflow is inefficient and error-prone, as it doesn't reliably deploy the intended branch, and I'm looking for a better way to handle branch switching without losing the environment configurations or causing deployment issues.

Thanks.

8 Replies

N/A


2 years ago

I think you want to be using railway environments


I'm curious could the "Check Suites" function help?


2 years ago

I'm sorry but I don't see how that's relevant


I'm thinking if I update the GitHub workflow file for different branch setting up different branch name, so when I switch to different branch and click the check suite button it will detect the branch difference and create the right instance using the correct branch instead of the original specificed one?


2 years ago

please research what check suites are, they are not applicable here given your original question


okay got it. thanks for the reply.


2 years ago

look into using environments -


Loading...