https://docs.railway.com/guides/environments#enable-pr-environments
these docs are pretty sparse on exactly how the PR environments work. I'm looking for some help in understanding from a functional perspective what Railway does when it consumes a pull request webhook from GitHub.
Here's what I'm trying to do:
- Pull Request is opened
- A new project (or is there a cleaner way?) is created with postgres and redis
- A container is built using railpack for the repo branch
- Custom start "pre-start" scripts (database migration and staging seed) are run
- The domain is generated and reported back to the PR
- Everything is configured as serverless
- When the PR is closed, the entire project/services are destroyed
Alternatively, we could use a single postgres + redis for all preview environmetns and just create a new database against that single postgres instance, but we would still need to teardown the DB name, etc on PR close/merge.
Any pointers?
Using Environments | Railway Docs
Manage complex development workflows via environments in your projects on Railway.