Deploying gitlab project

albertoHOBBY

a year ago

Hi

I'm trying deploy on railway using gitlab CI but it needs login with 'railway login'

$ railway up --service=$RAILWAYSERVICENAME -d
Unauthorized. Please login with railway login
Cleaning up project directory and file based variables
00:01
ERROR: Job failed: exit code 1

I can do that in local but, how do I do that from gitlab?

Thanks!

Solved

4 Replies

albertoHOBBY

a year ago

my gitlab-ci is:

stages:

  • deploy

deploy-railway:
stage: deploy
image: ubuntu
only:
- pushes
- main
script:
- apt-get update && apt-get install -y curl
- curl -fsSL https://railway.app/install.sh | sh
- railway up --service=$RAILWAYSERVICENAME -d


a year ago

Check out their blog post -

https://blog.railway.app/p/gitlab-ci-cd

It's a little old, but it gets the point across.


Status changed to Solved railway[bot] about 1 year ago


albertoHOBBY

a year ago

I have followed that guide,

i have created a empty service to get RAILWAYSERVICENAME, created a token in Railway and I have added that two variables on gitlab project RAILWAYTOKEN AND RAILWAYSERVICE_NAME.

Finally I have created gitlab-ci-yml file


albertoHOBBY

a year ago

Okay, it is running with the main branch, the error was coming out with another branch.

thanks!