Create PR Environment without Deploying
jjmilburn
PROOP

6 months ago

We use Neon (neon.tech) for our database, and when PRs are created, we've configured Neon to create a branched database via a Github action, which works fine.

However, we ended up with a race condition related to deployment with the Railway PR environments - where we essentially end up deploying the environment via the Railway Github integration, and then have to 'redeploy' after injecting the environment variables (from Github action) into Railway.

So, we are working on adding Github actions to basically replicate 90% of what the Railway integration already does (creating a new environment on PR creation, updating it on synchronize, deleting on PR deletion), all just to inject a DATABASE_URL from our branched database.

If there was a way to configure the Railway PR Environments to 'wait for deploy' until some other condition was reached, that would be great. I just came across the "Wait for CI" documentation, but it is unclear - will that setting prevent railway from:

1)Creating the environment until the Github checks complete?
2) Running the build step for services in the environment?

3) Deploying the services?

Ideally, we could configure the PR environment integration so that when we pushed a new MR, Railway:

  1. Created a new PR environment

  2. Ran build steps for the services

  3. Did NOT automatically deploy until the Github CI completes (which would allow us to inject the DATABASE_URL into the newly created environment as part of those steps)

Any tips?

Solved

2 Replies

jjmilburn
PROOP

6 months ago

Well, wait-for-ci as-is does what we need here, I think - I suppose just a better understanding of the internal steps in the Railway/Github integration "PR Environment Deployment Flow" and some way to more granularly control them is the ask here (e.g. can we gate certain parts, maybe the build, maybe the deploy, etc)


sarahkb125
EMPLOYEE

6 months ago

That's correct - you should use the wait for ci feature to wait until the Github actions complete. That should solve your issue


Status changed to Awaiting User Response Railway 6 months ago


Status changed to Solved sarahkb125 6 months ago


Loading...