3 months ago
Hi all, I’m trying to automate deployment of my Dockerized app to Railway using GitHub Actions.
Here’s what I’m doing:
Build the Docker image in GitHub Actions.
Push the image to Docker Hub (
crawan/housori-server:latest).Deploy the service on Railway using the Railway CLI with my Project Token.
Workflow snippet:
- name: Install Railway CLI
run: |
curl -fsSL https://railway.app/install.sh | sh
export PATH="$HOME/.railway/bin:$PATH"
- name: Deploy to Railway
run: railway deploy
env:
RAILWAY_TOKEN: ${{ secrets.RAILWAY_PROJECT_TOKEN }}Problem:
Railway shows errors in the dashboard:
Nixpacks build failed
No template specifiedI do not want Railway to build anything, just pull the Docker image from Docker Hub.
Tried
railway link,--service,--detachwith Project Token, but it fails.Using User API Key is interactive and not safe for CI/CD.
What I want:
Programmatically trigger Railway to roll out my prebuilt Docker image from Docker Hub using Project Token, without rebuilding.
Has anyone successfully done this in CI/CD? Any recommended workflow setup?
2 Replies
3 months ago
i think someone will take your post serious !
3 months ago
Hi, add a service on Railway, choose "Docker Image" and input your docker image. Do not choose "GitHub Repo".
Then on GitHub Actions, after pushing your Docker image, you can run railway redeploy -s your-service -y. This will pull and deploy the new image, without building.
Status changed to Solved timomeh • 2 months ago
