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.
No description
9 Replies
Percy
Percy3mo ago
Project ID: N/A
Mark_Chen
Mark_Chen3mo ago
N/A
Brody
Brody3mo ago
I think you want to be using railway environments
Mark_Chen
Mark_Chen3mo ago
I'm curious could the "Check Suites" function help?
Brody
Brody3mo ago
I'm sorry but I don't see how that's relevant
Mark_Chen
Mark_Chen3mo ago
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?
Brody
Brody3mo ago
please research what check suites are, they are not applicable here given your original question
Mark_Chen
Mark_Chen3mo ago
okay got it. thanks for the reply.
Brody
Brody3mo ago
look into using environments - https://docs.railway.app/guides/environments
Want results from more Discord servers?
Add your server