Skip to content

Commit

Permalink
[FEATURE] gen image for ecr
Browse files Browse the repository at this point in the history
  • Loading branch information
estebance committed Nov 26, 2024
1 parent 1974ee3 commit 3d8eaca
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/pipeline.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: CdkPipeline
on:
push:
branches:
- "develop"
- "feature/ecs"
env:
SABIO_PIPELINE_USER_ACCESS_KEY_ID: ${{ secrets.SABIO_AWS_ACCESS_KEY_ID }}
SABIO_PIPELINE_USER_SECRET_ACCESS_KEY: ${{ secrets.SABIO_AWS_SECRET_ACCESS_KEY }}
SABIO_DEV_PIPELINE_EXECUTION_ROLE: arn:aws:iam::908027390749:role/AWSControlTowerExecution
SABIO_DEV_REGION: us-east-1
jobs:
deploy:
if: github.ref == 'refs/heads/develop'
runs-on: ubuntu-latest
env:
APP_STAGE: dev
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: "20"
- name: deploy to account id
run: |
echo "Deploy to account: ${{ github.event.inputs.target_account_id}}"
- name: Assume the testing pipeline user role
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ env.SABIO_PIPELINE_USER_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ env.SABIO_PIPELINE_USER_SECRET_ACCESS_KEY }}
aws-region: ${{ env.SABIO_DEV_REGION }}
role-to-assume: ${{ env.SABIO_DEV_PIPELINE_EXECUTION_ROLE }}
role-session-name: dev-ecs-deployment
role-duration-seconds: 3600
role-skip-session-tagging: true
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2
- name: Build, tag, and push image to Amazon ECR
id: build-image
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
ECR_REPOSITORY: sabiocx/multiagent
IMAGE_TAG: ${{ github.sha }}
run: |
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
echo "image=$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG" >> $GITHUB_OUTPUT
8 changes: 8 additions & 0 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@
supervised_workflow = SupervisorWorkflow()
supervised_chain = supervised_workflow.gen_chain()

@app.get("/")
async def default():
return {
"data": {
"msg": "success"
}
}

# TODO manage request body
class SupervisorData(BaseModel):
message: str
Expand Down

0 comments on commit 3d8eaca

Please sign in to comment.