GitHub Actions and IaC - TypeScript SDK issue
escherwd
FREEOP

2 months ago

Hello, apologies if this has been posted before, but I am attempting to use GitHub Actions to apply my IaC config file (.railway/railway.ts) on commit, but keep running into an issue with the Railway TypeScript SDK not being available. Has anyone else successfully set up a workflow like this?

First iteration of my .github/workflows/deploy.yaml file (based off this guide):


name: Deploy to Railway

on:

  push:

    branches:

      - develop

jobs:

  deploy:

    runs-on: ubuntu-latest

    container: ghcr.io/railwayapp/cli:latest

    env:

      RAILWAY_TOKEN: ${{ secrets.RAILWAY_TOKEN_DEV }}

    steps:

      - uses: actions/checkout@v3
      - run: |

          # Send config

          railway config apply --yes

          # Upload service

          railway up --service=web -c

Resulting error:


Run railway config apply --yes

Could not find Railway configuration support for this project. Install the Railway TypeScript SDK, then run this command again: https://github.com/railwayapp/railway-ts-sdk

Caused by:

    No such file or directory (os error 2)

Second iteration, manually installing node/npm, manually installing the railway CLI and railway npm package (included in project's package.json):


name: Deploy to Railway

on:

  push:

    branches:

      - develop

jobs:

  deploy:

    runs-on: ubuntu-latest

    env:

      RAILWAY_TOKEN: ${{ secrets.RAILWAY_TOKEN_PROD }}

    steps:  

      - name: "Checkout"

        uses: actions/checkout@v3

      - name: "Install Node"

        uses: actions/setup-node@v7

        with:

          node-version: '26'

      - name: "Install Railway CLI"

        shell: bash

        run: bash <(curl -fsSL railway.com/install.sh) -y

      - name: "Install Railway TS dependancy"

        shell: bash

        run: npm ci

      - name: "Apply new Railway IaC Config"

        shell: bash

        run: ~/.railway/bin/railway config apply --yes

      - name: "Upload to Railway"

        shell: bash

        run: ~/.railway/bin/railway up --service=web -c

Once again:


Run ~/.railway/bin/railway config apply --yes

Could not find Railway configuration support for this project. Install the Railway TypeScript SDK, then run this command again: https://github.com/railwayapp/railway-ts-sdk

Caused by:

    No such file or directory (os error 2)

Any help or advice would be greatly appreciated!

$10 Bounty

1 Replies

Railway
BOT

2 months ago

This thread has been opened as a bounty so the community can help solve it.

Status changed to Open Railway • 2 months ago



Welcome!

Sign in to your Railway account to join the conversation.

Loading...