How can I deploy a staging and a production environment in railway?
I'm have one project and 2 environments in railway - staging and production. 
I've always just been deploying to production, but im finally adding a staging one lol. 
Can i use the wasp railway deploy command for both environments? or do i have to make full seperate projects?
1 Reply
Hi @Zuck. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
Currently, Wasp does not have a built-in one-line deploy command for Railway that supports multiple environments (like staging and production) out of the box. The official CLI deployment support for Railway is still in progress and tracked in this PR: Support one-line deployments to Railway, fully featured. Until this is merged and released, you need to follow the manual deployment process for each environment.
How to deploy to both staging and production on Railway:
- You do not need to create completely separate Railway projects; Railway supports multiple environments within a single project.
- For each environment (staging, production), you should:
  1. Build your Wasp app with 
wasp build.
  2. Use the Railway CLI to deploy to the desired environment. You will need to set the appropriate environment variables for each environment (e.g., different database URLs, secrets, etc.).
  3. When deploying, make sure you are targeting the correct Railway environment (you can select the environment in the Railway dashboard or via CLI).
  4. Repeat the deployment steps for both the server and client, as described in the manual deployment docs.
Key steps:
- Set environment-specific variables in Railway for each environment (staging and production).
- Use railway up in the appropriate build directories for both server and client, making sure you are deploying to the correct environment each time.
There is no mention in the knowledge sources of a wasp railway deploy command that automatically handles multiple environments. You must follow the manual process for now, but you can use the same Railway project with different environments configured within it, rather than creating entirely separate projects for staging and production deployments.
For more details, see the official docs on manual Railway deployment and updates & redeploying. The CLI support for Railway is coming soon, so keep an eye on the linked PR for updates.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @Zuck, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist:
Perhaps try again in 15mins?