fix(ci): replace node_modules artifacts with cache to fix 413 error

This commit is contained in:
Jordan Ramos
2026-05-26 16:22:28 -06:00
parent 2a3b25526f
commit 2328ecca6a

View File

@@ -32,20 +32,22 @@ install-backend:
image: node:18
script:
- npm ci
artifacts:
cache:
key: backend-${CI_COMMIT_REF_SLUG}
paths:
- node_modules/
expire_in: 1 hour
policy: push
install-frontend:
stage: install
image: node:18
script:
- cd frontend && npm ci
artifacts:
cache:
key: frontend-${CI_COMMIT_REF_SLUG}
paths:
- frontend/node_modules/
expire_in: 1 hour
policy: push
# =============================================================================
# STAGE 2: Lint
@@ -54,6 +56,11 @@ install-frontend:
lint-backend:
stage: lint
image: node:18
cache:
key: backend-${CI_COMMIT_REF_SLUG}
paths:
- node_modules/
policy: pull
script:
- node -c backend/server.js
- node -c backend/routes/*.js
@@ -65,6 +72,11 @@ lint-backend:
lint-frontend:
stage: lint
image: node:18
cache:
key: frontend-${CI_COMMIT_REF_SLUG}
paths:
- frontend/node_modules/
policy: pull
script:
- cd frontend && npx eslint src/ --ignore-pattern '**/__tests__/**' --ignore-pattern '**/*.test.js' --max-warnings 25
needs:
@@ -79,6 +91,11 @@ test-backend:
image: node:18
variables:
DATABASE_URL: $DATABASE_URL
cache:
key: backend-${CI_COMMIT_REF_SLUG}
paths:
- node_modules/
policy: pull
script:
- ./node_modules/.bin/jest --ci --forceExit backend/__tests__/
timeout: 5 minutes
@@ -88,6 +105,11 @@ test-backend:
test-frontend:
stage: test
image: node:18
cache:
key: frontend-${CI_COMMIT_REF_SLUG}
paths:
- frontend/node_modules/
policy: pull
script:
- cd frontend && CI=true npx react-scripts test --watchAll=false --ci
timeout: 5 minutes
@@ -101,6 +123,11 @@ test-frontend:
build-frontend:
stage: build
image: node:18
cache:
key: frontend-${CI_COMMIT_REF_SLUG}
paths:
- frontend/node_modules/
policy: pull
script:
- cd frontend && CI=false REACT_APP_API_BASE=/api REACT_APP_API_HOST="" npm run build
artifacts: