Lint, test, build, and deploy React/Vite/Next.js static web apps to AWS S3 + CloudFront with Cloudflare DNS.
Go to Settings > CI/CD > General pipelines and set CI/CD configuration file to:
https://gitlab-ci-yaml-template.enouvo.com/react-web/.gitlab-ci.yml
include: - 'https://gitlab-ci-yaml-template.enouvo.com/react-web/.gitlab-ci.yml'
WEB_URL | Public URL (e.g. https://myapp.example.com). Enables auto-discovery of S3 bucket and CloudFront. |
| Variable | Default | Description |
|---|---|---|
NODE_VERSION | 18.18 | Node.js version for build image |
AWS_BUCKET | auto-discovered from WEB_URL | S3 bucket name |
AWS_DISTRIBUTION_ID | auto-discovered | CloudFront distribution ID |
AWS_OIDC_ROLE_ARN | AWS role ARN for OIDC auth (no static keys needed) | |
DIST_DIRECTORY | build | Build output directory |
ENABLE_ESLINT_TEST | false | Enable ESLint in test stage (deprecated, lint now runs separately) |
When WEB_URL is set and a CloudFront distribution is found, these are auto-set:
| Variable | Auto Value |
|---|---|
CLOUDFLARE_RECORD_NAME | Domain from WEB_URL |
CLOUDFLARE_RECORD_CONTENT | CloudFront domain or S3 website endpoint |
CLOUDFLARE_RECORD_TYPE | CNAME |
CLOUDFLARE_ZONE_NAME | Root domain (e.g. example.com) |
You still need to set CLOUDFLARE_API_TOKEN manually.
Automatically uploads sourcemaps after build if configured:
| Variable | Description |
|---|---|
SENTRY_AUTH_TOKEN | Sentry auth token (masked) |
SENTRY_ORG | Organization slug |
SENTRY_PROJECT | Project slug |
SENTRY_URL | Self-hosted URL (default: https://sentry.io) |
test (lint + test in parallel) → build → scan → deploy → notify
SKIP_LINT=true SKIP_TEST=true SKIP_DEV_BUILD_REACT_WEB=true SKIP_STAGING_DEPLOY_REACT_WEB=true