a year ago
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,
deploy_railway:
runs-on: ubuntu-latest
needs: [db_migration]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Use Node 12
uses: actions/setup-node@v4
with:
node-version: 20
cache: yarn
- name: Install Railway
run: npm i -g @railway/cli
- name: Deploy
run: railway up --service api-server --verbose
env:
RAILWAY_TOKEN: ${{ secrets.RAILWAY_RELEASE_TOKEN }}Running this results in the error:
railway up
service: 9aad5d57-3685-492a-914a-df035b2faf7a
environment: 155bd4b0-26bd-451c-94db-54216985dd41
bytes: 260789612
url: https://backboard.railway.app/project/f87f4adf-2d4b-45bb-b71e-4ea8351c53be/environment/155bd4b0-26bd-451c-94db-54216985dd41/up?serviceId=9aad5d57-3685-492a-914a-df035b2faf7a
Uploading...
Failed to upload code with status code 520 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?
13 Replies
a year ago
yes you can use the verbose flag, that should print the tarball size
a year ago
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.
a year ago
it's uploading everything minus the files not allowed by your .gitignore
isolated or shared mono repo?
a year ago
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.
a year ago
fair
a year ago
you could use a .railwayignore file to ignore files / folders from being tarballed?
a year ago
same syntax as .gitignore
a year ago
No problem!