user28910750
user28910750

Reputation: 11

Railway build fails after this

Dockerfile:29

-------------------

27 |     # build phase

28 |     COPY . /app/.

29 | >>> RUN --mount=type=cache,id=s/32067775-089d-4ef2-80cf-47443e588357-node_modules/cache,target=/app/node_modules/.cache npm run build

30 |

31 |     # fmt phase

-------------------

ERROR: failed to solve: process "/bin/bash -ol pipefail -c npm run build" did not complete successfully: exit code: 1

The build is successful in my local, and it is getting deployed, when I am deploying it directly from my github repo. Althogh, CICD fails.

It was working few commits before. This is my workflow

`name: Deploy to Railway

on:
  push:
    branches:
      - main  # Triggers the workflow on each push to the 'main' branch.

jobs:
  build:
    name: Build
    runs-on: ubuntu-latest

    steps:
      - name: Checkout Repo
        uses: actions/checkout@v4

      - name: Set Up Node Environment
        uses: actions/setup-node@v4
        with:
          node-version: 16.x

      - name: Install Dependencies
        run: npm ci

      - name: Build Application
        run: npm run build --verbose

  deploy:
    name: Deploy to Railway
    runs-on: ubuntu-latest

    steps:
      - name: Checkout Repo
        uses: actions/checkout@v4

      - name: Install Railway CLI
        run: npm i -g @railway/cli

      - name: Deploy to Railway
        run: railway up --service frontend --environment production
        env:
          RAILWAY_TOKEN: ${{ secrets.RAILWAY_TOKEN }}
`

I tried clearing node_modules cache, deploying with other service, etc.. Local build is succesfull with 2 warnings.

Upvotes: 1

Views: 22

Answers (0)

Related Questions