a year ago
Hi, i'm trying to add a CI/CD to my project but the deploy part always fail saying File too large.
. But when i'm doing the same thing in my terminal it works just fine. Would you have an idea what i'm missing ?
image: node:latest
stages:
- build
- deploy
cache:
paths:
- node_modules/
- .pnpm-store
build_api:
stage: build
before_script:
- corepack enable
- corepack prepare pnpm@latest-8 --activate
- pnpm config set store-dir .pnpm-store
script:
- pnpm --filter api install --frozen-lockfile
- pnpm --filter api build
artifacts:
paths:
- packages/api/dist
only:
- main
build_intra:
stage: build
before_script:
- corepack enable
- corepack prepare pnpm@latest-8 --activate
- pnpm config set store-dir .pnpm-store
script:
- pnpm --filter intra install --frozen-lockfile
- pnpm --filter intra build
artifacts:
paths:
- packages/intra/.next
only:
- main
deploy_api:
stage: deploy
image: ubuntu
script:
- apt-get update && apt-get install -y curl
- curl -fsSL https://railway.app/install.sh | sh
- railway up --service=api -d
only:
- pushes
- main
environment:
name: production
url: https://your-api-url
deploy_intra:
stage: deploy
image: ubuntu
script:
- apt-get update && apt-get install -y curl
- curl -fsSL https://railway.app/install.sh | sh
- railway up --service=intra -d
only:
- pushes
- main
0 Replies
a year ago
that's what? 350 megabytes?
the limit is 40 as far as I know.
a year ago
download a zip of the repo, how big is the zip?
a year ago
then something you are doing is generating 345mb worth of data before uploading
a year ago
why do you have build stages in your action file?
It's not a good practice to have three stages in the CI/CD, test => build => deploy ?
a year ago
why not let railway do the building? it's not like they charge for the builder, and it's not like they are going to push the deployment if the build fails
a year ago
sounds good
I greatly reduced my action file :
stages:
- deploy
cache:
paths:
- node_modules/
- .pnpm-store
deploy_api:
stage: deploy
image: ubuntu
script:
- apt-get update && apt-get install -y curl
- curl -fsSL https://railway.app/install.sh | sh
- railway up --service=api -d
only:
- pushes
- main
environment:
name: production
url: https://your-api-url
deploy_intra:
stage: deploy
image: ubuntu
script:
- apt-get update && apt-get install -y curl
- curl -fsSL https://railway.app/install.sh | sh
- railway up --service=intra -d
only:
- pushes
- main
But the problem stay the same : Failed to upload code. File too large (321410994 bytes)
a year ago
you don't have anything in lfs?
a year ago
I mean railway isn't making up these numbers, the large upload data is coming from somewhere
zipped my api is 168 KB. Would it be possible that it is trying to push something with it ? Like railway itself that i just installed ? Idk i'm just trying to understand haha
a year ago
I mean it shouldn't, but even so, the railway binary isn't going to be anywhere near 320mb
Yeah but in that case how can we explain that it's working just fine from the terminal ?
There must be a difference between the two of them, something is trying to be pushed that isn't when i do it manually ?
a year ago
I mean gitlab ci environment and your local environment are vastly different things
a year ago
forgive me for asking as I know this is not a real solution, but simply moving your code over to github is not an option right?
a year ago
well there would be no need for the action file as railway can deploy straight from a github repo
I will try to do that, thanks for your help, still feels weird about this problem tho
a year ago
I agree, I am stumped