惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Engineering at Meta
Engineering at Meta
Microsoft Azure Blog
Microsoft Azure Blog
I
InfoQ
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
人人都是产品经理
人人都是产品经理
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
T
Tailwind CSS Blog
MongoDB | Blog
MongoDB | Blog
Google DeepMind News
Google DeepMind News
WordPress大学
WordPress大学
量子位
美团技术团队
大猫的无限游戏
大猫的无限游戏
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Last Week in AI
Last Week in AI
博客园 - 司徒正美
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
小众软件
小众软件
C
Check Point Blog
博客园 - 三生石上(FineUI控件)
N
Netflix TechBlog - Medium
Recent Announcements
Recent Announcements
有赞技术团队
有赞技术团队
月光博客
月光博客

Railway Blog

Where Railway is, and where it's going (Summer 2026) PaaS vs IaaS vs SaaS: What Each Means and Who Should Pick What in 2026 The Best Continuous Deployment Tools in 2026 The Best PaaS for Multi-Region Deployments in 2026 The Best Platforms for Monorepo Deployments in 2026 Compliance Isn't a Feature, It's a Posture What is BYOC (Bring Your Own Cloud)? A Developer's Guide for 2026 The Best Managed Kubernetes Hosting in 2026 The Best Container Registries in 2026 The Vanilla Cloud Tax: What Rolling Your Own on AWS Actually Costs What is a PaaS? A Developer's Guide for 2026 The Best Cloud Observability and Logging Tools in 2026 The Best PostgreSQL Hosting for Developers in 2026 The Best Multi-Region Hosting Platforms in 2026 The Best Platforms to Deploy AI Apps in 2026 (Not the Models, the Apps Around Them) Incident Report: May 19, 2026- GCP Account Suspension Counting to 3 with a new builder processing 50M+ monthly builds Railway iOS preview now available via TestFlight Kill your onboarding: selling to 10,000+ new users a day Your AI wants to nuke your database. Guardrails fix that. Better Rails for Agents: A New Remote MCP and Railway Agent in the CLI Moving Railway's Frontend Off Next.js One command deploys, there's a Stripe APP for that From registrar to deployed: buying a domain inside Railway A letter to open source builders who deserve more Networking is a black box, we used eBPF to open it Heroku Walked So Railway Can Run Security Features Your Security Team Will Love Railway Runs Open Source, Now We're Funding It Railway raises $100M Series B to unburden the builders
Using GitLab CI/CD with Railway
Railway · 2022-08-20 · via Railway Blog

GitLab CI/CD is a powerful continuous integration (CI) and continuous deployment (CD) system. In this post, we talk about how you can use GitLab CI/CD to automate your deployments on Railway.


If you haven't used it before, GitLab CI/CD allows you to automate several parts of your development workflow. Think about building your app, catching bugs, and maintaining code standards; the possibilities are endless. Recently, within our Discord, we've had a couple of users ask us how they'd go about deploying their app on Railway using GitLab so we thought it'd be a good idea to publish a short tutorial doing just that.

Project tokens

Railway provisions project tokens. They can be used in environments where you cannot login (CI in our case). It let’s CLI access all the variables and logs associated with a specific project and environment.

You can create a new project token on the Settings page of your project dashboard within the Tokens submenu.

Create project token
Create project token

Once you’ve created your project token, you can add it to your repository secrets on GitLab by visiting the Variables submenu under CI/CD settings.

Repository secrets
Repository secrets

Lights, camera, action!

workflow:
  rules:
    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH

railway-deploy:
  stage: deploy
  image: ghcr.io/railwayapp/cli:latest
  variables:
    SVC_ID: my-service-id
  script:
    - railway up --service=$SVC_ID

In this minimal example we use the CLI docker image as a base image for a job that will deploy to your service defined by the service Id. The workflow only triggers on pushes to projects default branch (usually main). Refer to the GitLab CI documentation to learn more about workflow configuration options.

Here, GitLab CI only provides a way to connect your code to Railway, the entire building part is handled by Railway build infrastructure. For some projects, it may be beneficial to handle the build stage within GitLab CI. In this case, you can still use the Railway CLI to deploy build artifacts (such as Golang or Rust binaries) to Railway.

Keep in mind that the RAILWAY_TOKEN must be kept secret, while service Id can be passed freely as a part of deploy command, or as an environment variable, defined inside the job configuration.

Pro Tip - An easy way to get the Service ID, or any other ID that may be needed - Open the service and then use the command pallet - cmd / ctrl + kcopy - and you will be given various options to copy an ID of your choosing into the clipboard, in this case you want the Service ID.

Conclusion

While this was a very basic example of deploying your application on Railway using GitLab CI/CD, you can do all sorts of things. We have users who use nixpacks (Railway’s build system) to dry-run their apps before deploying.

Let us know if you would like Railway to add direct GitLab integration by up-voting/commenting on this post or if you have any thoughts/feedback regarding this post. The easiest way to reach us is our Discord server.