Skip to content

CareStack-LLC/CommonGround-DEV1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1,440 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

GitHub Actions Automation for CommonGround

πŸ“¦ What's Included

This directory contains automated CI/CD workflows for the CommonGround co-parenting platform.

.github/
β”œβ”€β”€ workflows/
β”‚   β”œβ”€β”€ backend-ci.yml       # Backend testing + Render deployment
β”‚   β”œβ”€β”€ frontend-ci.yml      # Frontend testing + Vercel deployment
β”‚   └── ai-code-review.yml   # AI code review + security scanning
β”œβ”€β”€ AUTOMATION_SETUP.md      # Detailed setup guide
β”œβ”€β”€ QUICK_START.md           # 30-minute quick start
β”œβ”€β”€ validate-setup.sh        # Setup validation script
└── README.md                # This file

πŸš€ Quick Start

New to this? Start here:

  1. Read QUICK_START.md - Get up and running in 30 minutes
  2. Run validation: bash .github/validate-setup.sh
  3. Add required secrets to GitHub
  4. Push and watch it work!

Want all the details?

Read AUTOMATION_SETUP.md for comprehensive documentation.

🎯 What This Does

On Every Push to main:

  • βœ… Runs all tests (backend + frontend)
  • βœ… Checks code quality (linting, type checking)
  • βœ… Deploys backend to Render
  • βœ… Deploys frontend to Vercel
  • βœ… Performs health checks

On Every Pull Request:

  • βœ… Runs all tests
  • βœ… AI code review with Claude 3.5 Sonnet
  • βœ… Security scanning (vulnerabilities + secrets)
  • βœ… Deploys preview to Vercel
  • βœ… Comments on PR with feedback

πŸ“‹ Required Secrets

Add these at: https://github.com/simpletech310/CommonGround/settings/secrets/actions

Secret Purpose
VERCEL_TOKEN Deploy to Vercel
VERCEL_ORG_ID Vercel organization
VERCEL_PROJECT_ID Vercel project
RENDER_API_KEY Deploy to Render
RENDER_SERVICE_ID_BACKEND Render service ID
NEXT_PUBLIC_SUPABASE_URL Supabase connection
NEXT_PUBLIC_SUPABASE_ANON_KEY Supabase auth
ANTHROPIC_API_KEY AI reviews (optional)

See QUICK_START.md for how to get these values.

πŸ”§ Workflows

Backend Testing & Deployment

Runs on: Push/PR to main or develop (when backend files change)

What it does:

  1. Sets up Python 3.11 + PostgreSQL test database
  2. Installs dependencies from requirements.txt
  3. Runs ruff, black, mypy
  4. Runs pytest with coverage
  5. Deploys to Render (main only)
  6. Health check at /health

Frontend Testing & Deployment

Runs on: Push/PR to main or develop (when frontend files change)

What it does:

  1. Sets up Node.js 20
  2. Installs dependencies with npm ci
  3. Runs ESLint
  4. Runs TypeScript type checking
  5. Builds Next.js app
  6. Deploys to Vercel
    • Production: on main branch
    • Preview: on pull requests

AI Code Review & Security

Runs on: All pull requests

What it does:

  1. AI Review: Claude analyzes code for:

    • Security issues (XSS, SQL injection, etc.)
    • Type safety problems
    • Performance concerns
    • Best practice violations
  2. Security Scanning:

    • Trivy: Scans for vulnerabilities
    • TruffleHog: Detects leaked secrets
  3. Comments on PR with findings

βœ… Validation

Check if everything is set up correctly:

bash .github/validate-setup.sh

This script checks:

  • βœ… Directory structure
  • βœ… Workflow files
  • βœ… Project configuration
  • βœ… Git setup
  • βœ… Vercel/Render configuration

πŸ“Š Monitoring

View Workflow Runs

https://github.com/simpletech310/CommonGround/actions

Check Deployment Status

Frontend (Vercel):

Backend (Render):

πŸ› Troubleshooting

Workflows not running?

  1. Check workflow permissions:

    • Go to: Settings β†’ Actions β†’ General
    • Select "Read and write permissions"
    • Enable "Allow GitHub Actions to create and approve pull requests"
  2. Verify secrets are set:

    • Go to: Settings β†’ Secrets and variables β†’ Actions
    • Ensure all required secrets are present
  3. Check workflow files:

    ls -la .github/workflows/

    Should show all three .yml files

Deployment failing?

Backend (Render):

  • Check RENDER_API_KEY is correct
  • Verify RENDER_SERVICE_ID_BACKEND matches your service
  • Check Render dashboard for deployment logs

Frontend (Vercel):

  • Check VERCEL_TOKEN is valid
  • Verify VERCEL_ORG_ID and VERCEL_PROJECT_ID
  • Run npx vercel link to re-link if needed

AI review not working?

  • Check ANTHROPIC_API_KEY is set
  • Verify you have API credits
  • Check workflow logs for API errors

πŸŽ“ Team Workflow

For Developers:

# 1. Create feature branch
git checkout -b feature/my-feature

# 2. Make changes, commit
git add .
git commit -m "feat: add new feature"

# 3. Push
git push origin feature/my-feature

# 4. Create PR on GitHub
# 5. Wait for CI checks and AI review
# 6. Address feedback
# 7. Get approval and merge
# 8. Automatic deployment! πŸš€

What Happens Automatically:

Developer pushes code
         ↓
GitHub Actions triggers
         ↓
   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
   ↓          ↓              ↓
Backend    Frontend    AI Review
Tests      Tests       Security
   ↓          ↓              ↓
Deploy     Deploy      Comment
Render     Vercel      on PR
   ↓          ↓              ↓
Health     Preview     Report
Check      URL         Results

πŸ’° Cost Estimate

  • GitHub Actions: Free (2,000 min/month)
  • Vercel: Free tier
  • Render: $0-7/month
  • Anthropic API: $1-5/month

Total: ~$1-12/month

πŸ“š Documentation

🀝 Contributing

When modifying workflows:

  1. Test on a feature branch first
  2. Verify workflows run successfully
  3. Update documentation if needed
  4. Get team review before merging

πŸ“ž Support

  • Workflow Issues: Check Actions tab for logs
  • Deployment Issues: Check Vercel/Render dashboards
  • Setup Help: See AUTOMATION_SETUP.md

Ready to get started? Read QUICK_START.md β†’

About

CommonGround

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors