Project outside GitHub
cicerorph
HOBBYOP

3 months ago

I have my own Git instance for my projects, am I able to connect my repo through there?

$10 Bounty

3 Replies

3 months ago

Not directly, but you can use the Railway CLI and CI/CD to achieve the same thing pretty trivially:

https://docs.railway.com/cli/up#cicd-mode

If you're using Gitea, you can just add an action that builds your project, runs railway up --ci and then returns. Can have it spin up PR environments with a few lines of code in the same way 🙂

If it's another provider, you'll just have to use their version of Actions or some other CI/CD tooling


3 months ago

Here's a better example of this from the docs:

https://docs.railway.com/cli/deploying#cicd-integration


Anonymous
FREE

14 days ago

Railway’s native Git integration/autodeploy flow is mainly built around GitHub, so a self-hosted Git provider usually won’t connect to the dashboard the same way a GitHub repo does.

But you can still deploy code from any Git server by using the Railway CLI from a local clone or from your own CI.

A practical setup would be:

  1. Clone your self-hosted Git repo locally or in your CI runner.
  2. Install/login to the Railway CLI.
  3. Link the project/service once with railway link.
  4. Deploy with:

railway up

For automated deploys from a self-hosted Git provider, create a Railway project token, store it in your CI as RAILWAY_TOKEN, and run something like:

railway up --ci --service <service-name> --environment <environment-name>

So the short answer is: not as a native GitHub-style dashboard integration, but yes, you can deploy from a repo outside GitHub by using the Railway CLI or a CI pipeline that runs railway up.

Docs:

https://docs.railway.com/cli/deploying


Welcome!

Sign in to your Railway account to join the conversation.

Loading...