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