Controlling GitHub Autodeploys

Services that are linked to a GitHub repo automatically deploy when new commits are detected in the connected branch.

Configure the GitHub branch for deployment triggers

To update the branch that triggers automatic deployments, go to your Service Settings and choose the appropriate trigger branch.

Screenshot of GitHub Integration

Disable Automatic Deployments

To disable automatic deployment, simply hit Disconnect in the Service Settings menu.

Note: To manually trigger a deployment from the latest commit, use the Command Pallette: CMD + K -> "Deploy Latest Commit". This will deploy the latest commit from the Default branch in GitHub.

Currently, there is no way to force a deploy from a branch other than the Default without connecting it in your service settings.

Wait for CI

To ensure Railway waits for your GitHub Actions to run successfully before triggering a new deployment, you should enable Wait for CI.

Requirements

  • You must have a GitHub workflow defined in your repository.

  • The GitHub workflow must contain a directive to run on push:

    on:
      push:
        branches:
          - main

Enabling Wait for CI

If your workflow satisfies the requirements above, you will see the Wait for CI flag in service settings.

Check Suites Configuration

Toggle this on to ensure Railway waits for your GitHub Actions to run successfully before triggering a new deployment.

When enabled, deployments will be moved to a WAITING state while your workflows are running.

If any workflow fails, the deployments will be SKIPPED.

When all workflows are successful, deployments will proceed as usual.


Edit this file on GitHub