This directory contains CI/CD workflows for the AI Voice Loan Agent project.
| Workflow | Trigger | Purpose |
|---|---|---|
backend-ci.yml |
Push/PR to main/develop (backend changes) | Run backend tests, linting, and security scans |
frontend-ci.yml |
Push/PR to main/develop (frontend changes) | Run frontend tests, linting, and build |
scheduled-tests.yml |
Daily at 2 AM UTC | Run comprehensive test suite and security scans |
| Workflow | Trigger | Purpose |
|---|---|---|
docker-build.yml |
Push to main, version tags | Build and push Docker images to registry |
deploy-staging.yml |
Push to develop | Automatically deploy to staging environment |
deploy-production.yml |
Release published, manual | Deploy to production with approval |
| File | Purpose |
|---|---|
dependabot.yml |
Automated dependency updates for Python, npm, Docker, and GitHub Actions |
# Trigger any workflow
gh workflow run <workflow-name>.yml
# Examples
gh workflow run docker-build.yml
gh workflow run deploy-staging.yml
gh workflow run deploy-production.yml -f version=v1.0.0# List recent runs
gh run list
# View specific run
gh run view <run-id>
# View logs
gh run view <run-id> --log
# Watch a running workflow
gh run watchConfigure these in: Settings > Secrets and variables > Actions
| Secret | Description | Used By |
|---|---|---|
KUBE_CONFIG_STAGING |
Base64 encoded kubeconfig for staging | deploy-staging.yml |
KUBE_CONFIG_PRODUCTION |
Base64 encoded kubeconfig for production | deploy-production.yml |
SLACK_WEBHOOK |
Slack webhook URL for notifications | All deployment workflows |
GITHUB_TOKEN |
Automatically provided by GitHub | docker-build.yml |
Configure these in: Settings > Environments
| Environment | Protection Rules | URL |
|---|---|---|
staging |
None (auto-deploy) | https://staging.yourdomain.com |
production-approval |
Required reviewers | - |
production |
Required reviewers, deployment branches | https://yourdomain.com |
- Runs on: Ubuntu latest
- Python version: 3.10
- Services: MongoDB 6.0
- Steps: Install deps → Lint → Test → Security scan
- Coverage: Uploaded to Codecov
- Runs on: Ubuntu latest
- Node version: 18
- Steps: Install deps → Lint → Test → Build
- Coverage: Uploaded to Codecov
- Artifacts: Build output (7 days retention)
- Runs on: Ubuntu latest
- Registry: GitHub Container Registry (ghcr.io)
- Images: backend, frontend
- Tags: latest, version tags, branch-sha
- Security: Trivy vulnerability scanning
- Runs on: Ubuntu latest
- Environment: staging
- Steps: Update images → Deploy → Verify → Smoke tests
- Notifications: Slack on success/failure
- Runs on: Ubuntu latest
- Environment: production (requires approval)
- Steps: Backup → Update images → Deploy → Verify → Smoke tests
- Rollback: Automatic on failure
- Notifications: Slack on success/failure
- Runs on: Daily at 2 AM UTC
- Tests: Backend, Frontend, Integration, Security
- Notifications: Slack on failure only
Edit the on: section in workflow files:
on:
push:
branches: [main, develop, feature/*]
pull_request:
branches: [main]
schedule:
- cron: "0 2 * * *" # Daily at 2 AM UTC
workflow_dispatch: # Manual triggerEdit the test steps:
- name: Run tests
run: |
pytest -v --cov=app
# Add more test commandsEdit deployment steps in deploy-*.yml:
- name: Deploy to Kubernetes
run: |
kubectl apply -f k8s/
kubectl rollout status deployment/backendCreate new workflow file in .github/workflows/:
name: My Custom Workflow
on:
push:
branches: [main]
jobs:
my-job:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run custom script
run: ./scripts/my-script.sh- Check trigger conditions (branches, paths)
- Verify workflow file syntax (YAML)
- Check repository settings (Actions enabled)
- View logs:
gh run view <run-id> --log - Run tests locally to reproduce
- Check for environment-specific issues
- Check Kubernetes cluster connectivity
- Verify secrets are configured correctly
- Check image availability in registry
- Review deployment logs in Kubernetes
- Verify secret names match exactly
- Check environment configuration
- Ensure secrets are available in the environment
- Always test locally before pushing
- Use pull requests for code review
- Tag releases with semantic versioning
- Monitor workflow runs regularly
- Keep dependencies updated (Dependabot)
- Review security scans and fix vulnerabilities
- Use caching to speed up workflows
- Limit workflow runs to save minutes
For issues or questions:
- Check workflow logs
- Review this documentation
- Consult the CI/CD Guide
- Contact the DevOps team