Github actions testing and Railway CLI
I'm setting up Github actions in my repo to run my e2e testing before deploying to Railway. I need to use my environment variables from Railway for this (connection strings, etc)
I'm using secrets in Github with a project token to authenticate.
Whenever it gets to the testing step, I get this error:
Multiple services found. Please specify a service to pull variables from.
I only have one service, with one environment 'production', and just this one token.
This is what my Github action looks like for the test step:
And my test script starts the server like this: railway run npm run start
Can I get any assistance with setting this up properly?
I used this page: https://blog.railway.app/p/github-actions and the docs to set it up and from my understanding it seems correct.
Please and thank you!Solution:Jump to solution
you may have only one service, but an update was made to the cli that requires you specify the service you want to up into, since you could have a single database service in a project and up into that, if that database was in use, up'ing into that service would not be good, so while this was a breaking change, it was a much much needed change, hopefully in time they will update the article you read, but in the mean time, all you should need to do is add this flag
--service <service id>
to your...7 Replies
Project ID:
41f1e384-4e03-4db8-8977-4de7736f1111
41f1e384-4e03-4db8-8977-4de7736f1111
Solution
you may have only one service, but an update was made to the cli that requires you specify the service you want to up into, since you could have a single database service in a project and up into that, if that database was in use, up'ing into that service would not be good, so while this was a breaking change, it was a much much needed change, hopefully in time they will update the article you read, but in the mean time, all you should need to do is add this flag
--service <service id>
to your railway up
commandI definitely didn't see mention of that in the documentation. I'm probably blind though.
Thanks, Brody!
I'll try the change out tomorrow
you are not blind, it is a very recent change and has not made it into any documentation, so absolutely no worries
Can confirm it runs my tests now. Sweet. Thanks again
no problem!