a month ago
I found this article of yours: https://docs.railway.com/tutorials/github-actions-post-deploy
It looks like it fires every time a single service finished deploying.
My goal: Trigger a GitHub action that only runs when both services successfully deployed.
4 Replies
a month ago
Hey there! We've found the following might help you get unblocked faster:
🧵 How long after registration can one have the right to deploy services on GitHub?
🧵 Wait for CI skips deployments despite successful GitHub Actions completion
🧵 How to Deploy Multiple Services from Same Directory with Different Dockerfiles?
If you find the answer from one of these, please let us know by solving the thread!
a month ago
Hi there,
I have opened up this thread to the community.
Best,
The Railway Team
a month ago
To do this you'd have to create a separate workflow that waits for both post-deploy events, perhaps by using a status file/job dependency before running your action. you can configure your own workflow to check both service states (via artifacts or cache) and return success if it completed it.
a month ago
If I understood correctly you have 2 services that you want to deploy, and once they are both deployed you want to do something else, right?
If this is what you need then something like this:
jobs:
deploy:
runs-on: ubuntu-latest
container: ghcr.io/railwayapp/cli:latest
env:
RAILWAY_TOKEN: ${{ secrets.RAILWAY_TOKEN }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Deploy Service 1 to Railway and wait using -c
run: railway up -c --service=service-1
- name: Deploy Service 2 to Railway
run: railway up -c --service=service-2
- name: Whatever you need
run: ....should work, the -c wait for the service to be deployed