a year ago
Hey. I'm trying to set up a CI with railway using Github actions. Essentially I'm trying to do the following
Create a preview url (environment) for a new PR.
Inject that environment with a some env vars (specifically a DB url).
Know the preview url location so I can run playwright tests against that URL.
I figured I'd need to use the Railway CLI to do this, but it's been pretty cumbersome. Essentially it fails because I need to login. Looking at the docs, it seems I can use RAILWAY_TOKEN or RAILWAY_API_TOKEN to bypass login. But it doesn't look like you can use railway link? How am I supposed to tell railway to create a new environment for the PR, and then up the result?
I see that railways provides automatic PR environments, but I don't see how I'd be able to provide the vars to it through CI without login and link? Am I missing something.
22 Replies
i feel like something is set up wrong. If I enable "PR environments" in project settings, then my service that is connected to github, should create a new environment when I create a PR right?
@Brody sorry for the ping. I see you in most of these help threads, just hoping i could get a response.
a year ago
i didn't think the cli provides a way to create new environments to begin with?
It doesn't seem to. I guess what I'm wondering is how can I set up automated previews with railway if it can't? Seems like a pretty common use case?
a year ago
i dont think there is a good way to do it tbh
a year ago
Inject that environment with a some env vars
are you using an external database?
a year ago
neon?
It shouldnt matter. I'm just looking for a way to programaticly generate an environment, and supply it with a variable.
a year ago
its not something we support right now unfortunately
a year ago
we just dont support passing in specific variables for the PR envs
a year ago
perhaps you could do something custom with doppler?
I'll just look for a different platform. I wanted something like vercel, but not serverless.
a year ago
no problem!
a year ago
!s
Status changed to Solved brody • about 1 year ago