Deploying gitlab project
alberto
HOBBYOP

2 years ago

Hi

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

$ railway up --service=$RAILWAY_SERVICE_NAME -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

alberto
HOBBYOP

2 years 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=$RAILWAY_SERVICE_NAME -d


2 years 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 about 2 years ago


alberto
HOBBYOP

2 years ago

I have followed that guide,

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

Finally I have created gitlab-ci-yml file


alberto
HOBBYOP

2 years ago

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

thanks!


Welcome!

Sign in to your Railway account to join the conversation.

Loading...