Updating DB_URL in environment build?

alxcPRO

a year ago

I am using Neon as our database in develop and PR branches. We have a github action script that sets up the new environment on Neon and it returns a database URL. How can we update the database URL for the PR build from Github actions?If that's not possible, how can we trigger a PR environment from within Github actions?

2 Replies

a year ago

Hi,

Do you mind if I open this question up to the public? I think it would be a valuable discussion and I believe we have community members who have experience here...


a year ago

Railway does not natively provide a way to do this unfortunately, though you are far from the first person to ask for this exact usecase with neon or planet scale and their branches databases.

Someone has made a action that will call Railway's API to inject environment variables into services within the PR environment but it uses outdated API calls and the creator doesn't seem like they have an interest in updating it to use up-to-date API features, so I'm not sure how much I could personally recommend it, but I'll link it anyway for you to decide.

https://github.com/Faolain/railway-pr-deploy


Updating DB_URL in environment build? - Railway Help Station