The Frontend CI pipeline has been successfully implemented using GitHub Actions. It automatically runs build and format checks whenever a Pull Request is created or commits are pushed to the main branch affecting the frontend directory.
File: .github/workflows/frontend-ci.yml
- Pull Requests: Triggered on PRs to
mainbranch when frontend files change - Push Events: Triggered on direct pushes to
mainbranch when frontend files change - Path Filter: Only runs when files in
frontend/**or.github/workflows/frontend-ci.ymlare modified
- Command:
pnpm build(ornpm run build/yarn build) - Purpose: Ensures the frontend builds successfully without errors
- Failure Condition: Pipeline fails if build encounters any errors
- Command:
pnpm lint(ornpm run lint/yarn lint) - Purpose: Verifies code formatting and linting rules (ESLint)
- Configuration: Uses existing ESLint config in
frontend/eslint.config.mjs - Note: Currently set to
continue-on-error: true(non-blocking) for warnings
Frontend package advisories are scanned by .github/workflows/dependency-scan.yml using pnpm audit. Reports are uploaded as CI artifacts and summarized on the Actions run page. See DEPENDENCY_SCANNING.md for full details, local commands, and Dependabot configuration.
- Config:
frontend/security-headers.mjsviafrontend/next.config.ts - Purpose: Apply OWASP-recommended response headers on all routes
- Local verification:
pnpm test:security-headersorscripts/test-security-headers.sh - Docs:
SECURITY_HEADERS.md
✅ Package Manager Detection
- Automatically detects pnpm, yarn, or npm
- Uses the correct package manager for your project (pnpm in this case)
✅ Dependency Caching
- Caches
node_modulesand.next/cache - Speeds up workflow execution by ~1-2 minutes
- Cache key:
${{ runner.os }}-deps-${{ hashFiles(...) }}
✅ Node.js Environment
- Node.js 20 configured
- Compatible with Next.js 16.1.3
✅ Clear Error Messages
- Helpful output on failure
- Guides developers to fix issues
- Create a new branch:
git checkout -b test/ci-pipeline - Make a small change to a frontend file
- Commit and push:
git add . && git commit -m "test: verify ci pipeline"&&git push origin test/ci-pipeline - Open a Pull Request to
main - Check the PR for CI status
Verify build and lint checks pass locally before pushing:
cd frontend
pnpm install
pnpm lint # Format check
pnpm build # Build check- Code builds successfully with
pnpm build - ESLint passes with
pnpm lint - No syntax errors or TypeScript issues
- Build has errors (component imports, TypeScript errors, syntax issues)
- Linting errors are found (code style, unused variables, etc.)
-
Create feature branch
git checkout -b feature/new-component
-
Make changes to frontend code
-
Push to GitHub
git push origin feature/new-component
-
CI Pipeline Runs Automatically
- You'll see workflow status in the PR
- Red ❌ = Failed checks
- Green ✅ = Passed checks
-
Fix Issues (if needed)
# Run locally to test cd frontend pnpm lint # See linting errors pnpm build # See build errors
-
Commit and push fixes
git add . git commit -m "fix: resolve linting issues" git push origin feature/new-component
- Uses existing project dependencies (pnpm is the primary package manager)
- Node.js 20 LTS
- Next.js 16.1.3
- React 19.2.3
- All commands run from
frontend/directory viadefaults.run.working-directory - Keeps workflow clean and prevents path issues
- Caches across workflow runs
- Reset when
package-lock.json,pnpm-lock.yaml, oryarn.lockchanges - Significantly speeds up dependency installation
- Check the error message in GitHub Actions logs
- Run
cd frontend && pnpm install && pnpm buildlocally - Fix any TypeScript or syntax errors
- Commit and push changes
- Review linting errors in GitHub Actions output
- Run
cd frontend && pnpm lintlocally to see all issues - Fix formatting issues
- Some issues can be auto-fixed: Check ESLint documentation
If dependencies aren't installing correctly:
- Check GitHub Actions logs for cache hit/miss
- Cache automatically clears when lock files change
- Manual cache clear: Delete cache from GitHub Actions settings if needed
- Create a test PR to verify the pipeline works
- Document in contributing guide (if not already done)
- Enable branch protection (optional):
- Go to repository settings
- Select
mainbranch - Check "Require status checks to pass before merging"
- Select "Frontend Build and Format Checks"
- Workflow: .github/workflows/frontend-ci.yml
- Dependency scanning: .github/workflows/dependency-scan.yml
- Dependency scanning guide: DEPENDENCY_SCANNING.md
- Security headers: SECURITY_HEADERS.md
- Security headers config: frontend/security-headers.mjs
- ESLint Config: frontend/eslint.config.mjs
- Package Manager: frontend/pnpm-lock.yaml
- Contributing Guide: contributor.md
Implementation Date: January 22, 2026 Workflow Version: 1.0