Fix tests

This commit is contained in:
Arthur Belleville 2025-10-23 23:04:56 +02:00
parent 62ac5e054e
commit 33d16e71ec
No known key found for this signature in database
2 changed files with 42 additions and 14 deletions

View file

@ -109,12 +109,23 @@ jobs:
build-apps:
executor: node-executor
parameters:
environment:
type: string
default: "staging"
steps:
- checkout
- setup-pnpm
- run:
name: Build all apps
command: pnpm run build:apps
name: Build main app for << parameters.environment >>
command: |
cd apps/main
npm run build:<< parameters.environment >>
- run:
name: Build external app
command: |
cd apps/external
npm run build
- persist_to_workspace:
root: .
paths:
@ -124,7 +135,7 @@ jobs:
- packages/shared/dist
- store_artifacts:
path: apps/main/dist
destination: main-app
destination: main-app-<< parameters.environment >>
- store_artifacts:
path: apps/external/dist
destination: external-app
@ -194,20 +205,25 @@ jobs:
at: .
- setup-pnpm
- run:
name: Deploy frontend to staging
name: Deploy main app to staging
command: |
cd apps/main
echo "Deploying main app to staging..."
# Uncomment and configure your Cloudflare deployment
echo "Deploying main app to staging environment..."
npx wrangler deploy --env staging
- run:
name: Deploy external app to staging
command: |
cd apps/external
echo "Deploying external app to staging..."
# Add external app staging deployment if needed
# npx wrangler deploy --env staging
echo "Set CLOUDFLARE_API_TOKEN in CircleCI environment variables"
- run:
name: Deploy API to staging
command: |
echo "Deploying API to staging environment..."
# Add your API deployment commands here
# Example for Google Cloud Run:
# gcloud run deploy xtablo-api --image gcr.io/${GCP_PROJECT}/xtablo-api:${CIRCLE_SHA1} --region us-central1
# gcloud run deploy xtablo-api-staging --image gcr.io/${GCP_PROJECT}/xtablo-api:${CIRCLE_SHA1} --region us-central1
deploy-production:
executor: node-executor
@ -217,15 +233,25 @@ jobs:
at: .
- setup-pnpm
- run:
name: Deploy frontend to production
name: Deploy main app to production
command: |
echo "Deploying to production..."
pnpm run deploy:all
cd apps/main
echo "Deploying main app to production environment..."
npx wrangler deploy --env production
- run:
name: Deploy external app to production
command: |
cd apps/external
echo "Deploying external app to production..."
# Add external app production deployment if needed
# npx wrangler deploy --env production
- run:
name: Deploy API to production
command: |
echo "Deploying API to production environment..."
# Add your production API deployment commands here
# Example for Google Cloud Run:
# gcloud run deploy xtablo-api --image gcr.io/${GCP_PROJECT}/xtablo-api:${CIRCLE_SHA1} --region us-central1
# Workflows
workflows:
@ -272,8 +298,9 @@ workflows:
- test-unit
- test-api
# Build phase
# Build phase for staging
- build-apps:
environment: "staging"
requires:
- test-lint
- test-typecheck
@ -304,8 +331,9 @@ workflows:
- test-unit
- test-api
# Build phase
# Build phase for production
- build-apps:
environment: "prod"
requires:
- test-lint
- test-typecheck

View file

@ -42,7 +42,7 @@ export const ProtectedRoute = ({ fallback, shouldRedirectToCurrentPage }: Protec
return match(status)
.with("loading", () => <LoadingSpinner />)
.with("should-land-user", () => <Navigate to={redirectUrl} replace />)
.with("should-land-user", () => <Navigate to="/landing" replace />)
.with("should-redirect", () => <Navigate to={redirectUrl} replace />)
.with("should-pass", () => <Outlet />)
.exhaustive();