This directory contains GitHub Actions workflows for automated CI/CD.
Triggers: Push to main/develop, Pull Requests
Purpose: Comprehensive testing and quality assurance
Steps:
- ✅ Checkout code
- 🔧 Setup Node.js (18.x, 20.x)
- 📦 Install dependencies
- 🛡️ Run ESLint
- 🔷 TypeScript type checking
- 🏗️ Build project
- 📦 Upload build artifacts
- 🧪 Run tests (if available)
- 🔒 Security audit
- 🚀 Preview deployment (PRs only)
Triggers: Push to main, Release creation
Purpose: Production deployment and release management
Steps:
- ✅ Checkout code
- 🔧 Setup Node.js 20.x
- 📦 Install dependencies
- 🛡️ Run ESLint
- 🔷 TypeScript type checking
- 🏗️ Build project
- 🚀 Deploy to Vercel (Production)
- 🏷️ Create automated release
Triggers: Pull Requests Purpose: Fast feedback for developers
Steps:
- ✅ Checkout code
- 🔧 Setup Node.js 20.x
- 📦 Install dependencies
- 🛡️ Run ESLint
- 🔷 TypeScript type checking
- 🏗️ Build project
- 💬 Comment on PR
- Go to your repository settings
- Navigate to "Actions" → "General"
- Enable "Allow all actions and reusable workflows"
Add these secrets in your repository settings:
For Vercel Deployment:
VERCEL_TOKEN- Get from Vercel dashboardVERCEL_ORG_ID- Your Vercel organization IDVERCEL_PROJECT_ID- Your Vercel project ID
How to get Vercel credentials:
- Install Vercel CLI:
npm i -g vercel - Run
vercel login - Run
vercel linkin your project - Check
.vercel/project.jsonfor IDs
- Go to repository settings → "Branches"
- Add rule for
mainbranch:- ✅ Require status checks to pass
- ✅ Require branches to be up to date
- ✅ Select required status checks:
build-and-testsecurity-audit
Tests against multiple Node.js versions (18.x, 20.x)
Uses npm cache for faster builds
Automatic security audits on dependencies
- Preview deployments for PRs
- Production deployments for main branch
- Automated release creation
Automatic comments on PRs when checks pass
-
Build fails on ESLint
- Run
npm run lint:fixlocally - Check for
anytypes usage
- Run
-
TypeScript errors
- Run
npx tsc --noEmitlocally - Fix type issues before pushing
- Run
-
Deployment fails
- Verify Vercel secrets are correct
- Check Vercel project configuration
Test workflows locally using act:
# Install act
brew install act
# Test specific workflow
act pull_request -W .github/workflows/quick-check.yml- Edit the appropriate workflow file
- Add new steps after existing ones
- Test locally before pushing
Update the on section in workflow files:
on:
push:
branches: [ main, develop, feature/* ]
pull_request:
branches: [ main ]Add environment-specific variables:
env:
NODE_ENV: production
API_URL: ${{ secrets.API_URL }}