Skip to content

Commit e0fbf20

Browse files
workflow test 1
1 parent e6b2d2c commit e0fbf20

3 files changed

Lines changed: 106 additions & 105 deletions

File tree

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
name: Research Agent CI/CD
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- 'agents/research_agent/**'
8+
# - '**.py'
9+
# - '**.html'
10+
pull_request:
11+
branches: [ main ]
12+
paths:
13+
- 'agents/research_agent/**'
14+
15+
env:
16+
python-version: '3.9'
17+
18+
jobs:
19+
unit_test:
20+
name: Run unit tests
21+
runs-on: ubuntu-latest
22+
23+
steps:
24+
- name: Code checkout
25+
uses: actions/checkout@v4
26+
27+
- name: Setup Python
28+
uses: actions/setup-python@v5
29+
with:
30+
python-version: ${{ env.python-version }}
31+
cache: 'pip' # caching pip dependencies
32+
33+
- name: Install dependencies
34+
run: pip install -r agents/research_agent/requirements.txt
35+
36+
build_and_deploy:
37+
name: Build, Scan, Push, and Deploy
38+
runs-on: ubuntu-latest
39+
needs: [unit_test]
40+
environment: Production
41+
42+
env:
43+
REGISTRY: docker.io
44+
CONTAINER_REPO: ${{ secrets.REG_USER }}/${{ secrets.CONTAINER_REPOSITORY_NAME }}
45+
IMAGE_TAG: llm_research_agent:${{ github.run_number }}
46+
47+
steps:
48+
- name: Code checkout
49+
uses: actions/checkout@v4
50+
51+
- name: Log in to Azure
52+
uses: azure/login@v1
53+
with:
54+
creds: ${{ secrets.AZURE_CREDENTIALS }}
55+
56+
- name: Login to Docker Container Registry
57+
uses: docker/login-action@v3
58+
with:
59+
registry: ${{ env.REGISTRY}}
60+
username: ${{ secrets.REG_USER }}
61+
password: ${{ secrets.REG_TOKEN }}
62+
63+
- name: Setup Docker
64+
uses: docker/setup-buildx-action@v3
65+
66+
- name: Build Docker Image
67+
uses: docker/build-push-action@v6
68+
with:
69+
context: ./agents/research_agent
70+
push: false
71+
tags: ${{ env.REGISTRY }}/${{ env.CONTAINER_REPO }}/${{ env.IMAGE_TAG }}
72+
load: true
73+
74+
- name: Run vulnerability scan (Trivy)
75+
uses: aquasecurity/trivy-action@0.30.0
76+
with:
77+
image-ref: ${{ env.REGISTRY }}/${{ env.CONTAINER_REPO }}/${{ env.IMAGE_TAG }}
78+
format: 'table'
79+
#exit-code: '1'
80+
ignore-unfixed: true
81+
vuln-type: 'os,library'
82+
severity: 'CRITICAL'
83+
84+
- name: Push images to DHCR
85+
run: docker push ${{ env.REGISTRY }}/${{ env.CONTAINER_REPO }}/${{ env.IMAGE_TAG }}
86+
87+
- name: Output Image name
88+
run: echo "image_tag=$(echo ${{ github.run_number }})" >> $GITHUB_OUTPUT
89+
90+
- name: Deploy to Azure Container Apps
91+
uses: Azure/container-apps-deploy-action@v2
92+
with:
93+
imageToDeploy: ${{ env.REGISTRY }}/${{ env.CONTAINER_REPO }}/${{ env.IMAGE_TAG }}
94+
containerAppName: ${{ secrets.AZURE_APP_NAME }}
95+
resourceGroup: ${{ secrets.AZURE_RG_NAME }}
96+
containerAppEnvironment: ${{ secrets.AZURE_ENV_NAME }}
97+
environmentVariables: |
98+
GOOGLE_API_KEY=${{ secrets.GOOGLE_API_KEY }}
99+
100+
101+
102+
103+
104+
105+

.github/workflows/research-ci.yml

Lines changed: 0 additions & 104 deletions
This file was deleted.

agents/research_agent/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
llm = ChatGoogleGenerativeAI(model="gemini-2.0-flash", google_api_key=google_api_key)
1616

1717

18-
# ----------------- Research Agent Setup -----------------
18+
# ----------------- Research Agent Setup ----------------- #
1919
# Define the prompt for generating research
2020
research_prompt = ChatPromptTemplate.from_messages(
2121
[

0 commit comments

Comments
 (0)