This repository includes a comprehensive CI/CD pipeline setup using GitHub Actions for automated testing, building, and deployment.
- Triggers: Push to
main,develop, PRs tomain - Features:
- ✅ Automated testing with Vitest
- 🏗️ Build verification
- 🔍 ESLint code quality checks
- 📊 Test coverage reporting
- 💬 Automatic PR comments with test results
- 🏷️ Status badges for repository
- Triggers: Manual dispatch, Git tags (
v*) - Features:
- 🔖 Automated version management
- 📝 Changelog generation from git commits
- 📦 Build artifacts (tar.gz, zip)
- 🚀 GitHub Pages deployment
- 📋 Release notes creation
- 🎯 Production-ready builds
- Triggers: Push to feature branches (
feature/*,develop) - Features:
- 🧪 Development branch testing
- 📅 Timestamp-based versioning
- 🧹 Automatic cleanup of old pre-releases
- 📦 Development artifacts
- 🔄 Continuous integration for development
- Triggers: Manual dispatch with version type selection
- Features:
- 📈 Semantic version bumping (patch/minor/major)
- 🔀 Pre-release versioning (alpha/beta/rc)
- 📝 Automatic CHANGELOG.md updates
- 🔄 Pull request creation for review
- ✨ Automated commit messages
- Triggers: Deployment events, workflow completions
- Features:
- 📊 Deployment status tracking
- 🎉 Success notifications
- ❌ Failure alerts with troubleshooting
- 🔗 Live URL notifications
-
Enable GitHub Actions:
- Go to repository Settings → Actions → General
- Allow "Read and write permissions" for GITHUB_TOKEN
-
Configure GitHub Pages:
- Go to Settings → Pages
- Source: "GitHub Actions"
- This enables automatic deployment
-
Repository Secrets (Optional):
- All workflows use the default
GITHUB_TOKEN - No additional secrets required for basic setup
- All workflows use the default
-
Version Bump:
# Option 1: Use GitHub UI Go to Actions → Version Bump → Run workflow Select version type (patch/minor/major) # Option 2: Manual tag git tag v1.0.0 git push origin v1.0.0
-
Review and Merge:
- Version bump creates a PR automatically
- Review changes in CHANGELOG.md
- Merge the PR
-
Create Release:
- Go to Actions → Release → Run workflow
- Or push a tag to trigger automatically
Add these badges to your README.md:



- Parallel Testing: Tests run on multiple Node.js versions
- Coverage Reports: Automatically generated and commented on PRs
- Failure Notifications: Detailed error reporting in PR comments
- Cache Optimization: npm dependencies cached for faster builds
- Semantic Versioning: Automatic version detection from tags
- Changelog Generation: Git commits automatically formatted
- Multi-format Artifacts: Both tar.gz and zip distributions
- GitHub Pages: Automatic deployment with custom domain support
- Release Notes: Formatted release descriptions
- Minimal Permissions: Each job has specific permission scopes
- Token Security: Uses GitHub's built-in GITHUB_TOKEN
- Dependency Security: npm audit checks in CI pipeline
- Build Verification: All artifacts verified before deployment
Edit .github/workflows/ci.yml:
# Add more Node.js versions
strategy:
matrix:
node-version: [18.x, 20.x, 22.x]
# Add more test commands
- name: Run additional tests
run: npm run test:e2eEdit .github/workflows/release.yml:
# Change deployment target
- name: Deploy to custom server
run: |
# Your custom deployment script
./deploy.shenv:
NODE_ENV: production
API_URL: ${{ secrets.API_URL }}-
Tests Failing:
- Check test logs in Actions tab
- Verify all dependencies are installed
- Ensure test files are properly configured
-
Deployment Failures:
- Verify GitHub Pages is enabled
- Check repository permissions
- Ensure build artifacts are generated
-
Version Bump Issues:
- Verify package.json exists
- Check Git permissions
- Ensure CHANGELOG.md format is correct
Add this to any workflow for verbose logging:
env:
ACTIONS_STEP_DEBUG: true- View workflow runs in Actions tab
- Monitor deployment frequency
- Track test success rates
- Analyze build times
- Use dependency caching
- Parallel job execution
- Minimal artifact sizes
- Efficient Docker layers (if using containers)
When contributing to this repository:
- Create feature branches:
feature/your-feature-name - All PRs trigger automated testing
- Ensure tests pass before requesting review
- Follow semantic commit messages for changelog generation
💡 Tip: This pipeline is designed to be zero-configuration. Just push your code and let GitHub Actions handle the rest!