Skip to content

fix(ci): resolve pre-existing lint and test failures (#64) #78

fix(ci): resolve pre-existing lint and test failures (#64)

fix(ci): resolve pre-existing lint and test failures (#64) #78

name: Deploy to Vertex AI Agent Engine
on:
push:
branches:
- main
paths:
- 'agents/**'
- 'scripts/quick_deploy.py'
- '.github/workflows/deploy-agent-engine.yml'
workflow_dispatch:
inputs:
deploy_mode:
description: 'Deployment mode'
required: true
default: 'all'
type: choice
options:
- all
- bob-only
- specialists-only
environment:
description: 'Environment (dev/staging/prod)'
required: true
default: 'dev'
type: choice
options:
- dev
- staging
- prod
env:
GCP_PROJECT_ID: bobs-brain
GCP_LOCATION: us-central1
PYTHON_VERSION: '3.12'
permissions:
contents: read
id-token: write # Required for Workload Identity Federation (R4)
jobs:
deploy:
name: Deploy Agents to Agent Engine
runs-on: ubuntu-latest
environment: ${{ inputs.environment || 'dev' }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Authenticate to Google Cloud
uses: google-github-actions/auth@v2
with:
workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }}
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v2
- name: Verify authentication
run: |
gcloud auth list
gcloud config list project
gcloud config set project ${{ env.GCP_PROJECT_ID }}
- name: Install dependencies
run: |
pip install google-cloud-aiplatform
- name: List current deployments
run: |
echo "📋 Current Agent Engine deployments:"
python3 scripts/quick_deploy.py list
- name: Deploy agents
id: deploy
run: |
echo "🚀 Deploying agents..."
echo "Mode: ${{ github.event.inputs.deploy_mode || 'all' }}"
echo "Environment: ${{ github.event.inputs.environment || 'dev' }}"
python3 scripts/quick_deploy.py deploy-all | tee deploy_output.txt
echo "✅ Deployment complete"
- name: Verify deployment
run: |
echo "✅ Verifying all agents are deployed..."
python3 scripts/quick_deploy.py list
- name: Extract deployment summary
run: |
echo "📊 Deployment Summary:"
grep -A 20 "Deployment Summary" deploy_output.txt || true
echo ""
echo "📋 Agent IDs:"
grep ":" deploy_output.txt | grep -v "Deploying" | tail -10 || true
- name: Update registry
run: |
echo "📝 Agent Registry:"
cat 000-docs/agent-engine-registry.csv | grep DEPLOYED | wc -l
echo "agents deployed"
- name: Upload deployment artifacts
uses: actions/upload-artifact@v4
with:
name: deployment-logs-${{ github.run_number }}
path: |
deploy_output.txt
000-docs/agent-engine-registry.csv
- name: Notify on success
if: success()
run: |
echo "✅ All agents deployed successfully to Agent Engine!"
echo "🔗 View in GCP Console:"
echo "https://console.cloud.google.com/vertex-ai/reasoning-engines?project=${{ env.GCP_PROJECT_ID }}"
smoke-test:
name: Smoke Tests
needs: deploy
runs-on: ubuntu-latest
if: success()
environment: ${{ inputs.environment || 'dev' }}
permissions:
contents: read
id-token: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Authenticate to Google Cloud
uses: google-github-actions/auth@v2
with:
workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }}
- name: Install dependencies
run: |
pip install -r requirements.txt
- name: Verify all agents are accessible
run: |
echo "🧪 Verifying all 10 agents are accessible..."
python3 scripts/quick_deploy.py list | grep "Found" | grep "13"
if [ $? -eq 0 ]; then
echo "✅ All 13 agents found (10 new + 3 legacy)"
else
echo "❌ Expected 13 agents"
exit 1
fi
- name: Health check placeholder
run: |
echo "🏥 Health checks:"
echo " - All 10 Hard Mode agents deployed ✅"
echo " - Agent Engine IDs assigned ✅"
echo " - Registry CSV updated ✅"
echo ""
echo "TODO: Implement A2A communication tests"
echo "TODO: Implement per-agent health checks"
update-registry:
name: Commit Updated Registry
needs: [deploy, smoke-test]
runs-on: ubuntu-latest
if: success() && github.event_name == 'push'
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download deployment artifacts
uses: actions/download-artifact@v4
with:
name: deployment-logs-${{ github.run_number }}
- name: Commit updated registry
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
if git diff --quiet 000-docs/agent-engine-registry.csv; then
echo "No changes to registry"
else
git add 000-docs/agent-engine-registry.csv
git commit -m "chore(agent-engine): update registry with deployment IDs [skip ci]"
git push
echo "✅ Registry committed"
fi