Railway up fails to upload in Github Action
I'm trying to deploy via Github Actions so my railway server deploys after db migrations are complete. Here's what the railway part of the action looks like,
Running this results in the error:
Doing the same locally shows a more specific error message:
Failed to upload code. File too large (260810846 bytes)
.
I saw from previous threads that the railway up file limit is 40mb. Is there anyway to log what's being zipped and uploaded to railway? How does this work when it's connected via GitHub on Railway but breaks through the CLI?Solution:Jump to solution
you could use a .railwayignore file to ignore files / folders from being tarballed?
12 Replies
Project ID:
9aad5d57-3685-492a-914a-df035b2faf7a,155bd4b0-26bd-451c-94db-54216985dd41,f87f4adf-2d4b-45bb-b71e-4ea8351c53be,155bd4b0-26bd-451c-94db-54216985dd41,9aad5d57-3685-492a-914a-df035b2faf7a
yes you can use the verbose flag, that should print the tarball size
and yes 40MB is the maximum size
Is there anyway to see and control what's actually being uploaded? verbose flag only shows the total file size, doesn't show what it's uploading. This is in a monorepo so I'm guessing that's why it's exceeding file limits, but not everything in the monorepo is needed for this service.
it's uploading everything minus the files not allowed by your .gitignore
isolated or shared mono repo?
shared
may I ask why not deploy straight from GitHub instead of using railway up?
we have a github action to manage deploys, this includes db migrations and deploying other services. If we don't wait for CI, then the railway service can be deployed before the db migrations are finished. If we wait for CI, it then has to wait for the whole action to be finished which includes the building for other services, so the railway service gets deployed like 5 mins later than it should. Trying to place it in the action so we can deploy right after the migrations are done, to minimize the time there's discrepancy between the deployed code / db migration.
fair
Solution
you could use a .railwayignore file to ignore files / folders from being tarballed?
same syntax as .gitignore
oh didn't know that was a thing, thanks i'll try that
nice that worked perfectly, thanks for the help!
No problem!