Deployment Guide
This guide will help you deploy the ECC learning site to Vercel and configure CI/CD automation.
π Quick Deploy to Vercelβ
Option 1: One-Click Deploy (Recommended for beginners)β
Click the button below to deploy to Vercel in one click:
Option 2: Manual Deploymentβ
1. Install the Vercel CLIβ
npm install -g vercel
2. Log in to Vercelβ
vercel login
3. Deploy the Projectβ
cd ecc-docs
vercel
On first deployment, Vercel will ask some configuration questions:
- Set up and deploy? Yes
- Which scope? Select your account
- Link to existing project? No
- Project name? ecc-learning-site
- Directory? ./
- Override settings? No
βοΈ CI/CD Configurationβ
GitHub Actions Workflowsβ
The project comes with pre-configured GitHub Actions, including two workflows:
CI Workflow (ci.yml)β
Runs automatically on every push or PR:
- β Unit tests
- β Build verification
- β E2E tests
Deploy Workflow (deploy.yml)β
Automatically deploys when pushed to the main branch:
- β Run CI checks
- β Deploy to Vercel
- β Verify deployment
Configure GitHub Secretsβ
Add the following Secrets in your GitHub repository settings:
| Secret Name | Description | How to Obtain |
|---|---|---|
VERCEL_TOKEN | Vercel API Token | Vercel Settings |
VERCEL_ORG_ID | Vercel Organization ID | .vercel/project.json |
VERCEL_PROJECT_ID | Vercel Project ID | .vercel/project.json |
π Environment Variablesβ
Local Developmentβ
Copy .env.example to .env.local:
cp .env.example .env.local
Edit .env.local and fill in your configuration.
Vercel Environment Variablesβ
Configure environment variables in Vercel project settings:
- Open the Vercel Dashboard
- Select your project
- Go to Settings β Environment Variables
- Add the required variables
π Deployment Checklistβ
Confirm before deploying:
- All unit tests pass (
npm test) - Build succeeds (
npm run build) - E2E tests pass (
npm run test:e2e) - Environment variables are configured
- GitHub Secrets are set up
π Custom Domainβ
Add a Custom Domainβ
- Open the project in the Vercel Dashboard
- Go to Settings β Domains
- Add your domain
- Configure DNS records
DNS Configuration Exampleβ
| Type | Name | Value |
|---|---|---|
| CNAME | www | cname.vercel-dns.com |
| A | @ | 76.76.19.19 |
π§ Advanced Configurationβ
Custom Build Commandβ
Edit vercel.json:
{
"buildCommand": "npm run build",
"outputDirectory": "build"
}
Configure Redirectsβ
{
"redirects": [
{
"source": "/old-path",
"destination": "/new-path",
"permanent": true
}
]
}
Configure Security Headersβ
The project comes pre-configured with these security headers:
X-Frame-Options: DENYX-Content-Type-Options: nosniffX-XSS-Protection: 1; mode=blockReferrer-Policy: strict-origin-when-cross-origin
π Monitoring and Analyticsβ
Vercel Analyticsβ
Enable Analytics in the Vercel Dashboard:
- Go to project settings
- Select Analytics
- Enable Web Analytics
Performance Monitoringβ
Monitor with Vercel Speed Insights:
- First Contentful Paint (FCP)
- Largest Contentful Paint (LCP)
- Cumulative Layout Shift (CLS)
π FAQβ
Build Failureβ
- Check that the Node.js version is 20+
- Verify that
package-lock.jsonis committed - Review build logs for errors
404 After Deploymentβ
- Verify the
outputDirectoryconfiguration is correct - Check rewrite rules
- Clear Vercel cache and redeploy
Environment Variables Not Workingβ
- Verify variable names are correct
- Check variable scope (Production/Preview/Development)
- Redeploy for variables to take effect