Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions .github/workflows/add-to-project.yml

This file was deleted.

59 changes: 59 additions & 0 deletions .github/workflows/cd-production.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Deploy AI Platform to ECS Production

on:
push:
tags:
- 'v*' # Deploy only when tags like v1.0.0, v2.1.0, etc., are created

jobs:
build:
runs-on: ubuntu-latest

permissions:
packages: write
contents: read
attestations: write
id-token: write

steps:
- name: Checkout the repo
uses: actions/checkout@v4

- name: Check if tag is from main branch
id: check-branch
run: |
if [ "$(git branch -r --contains ${{ github.ref }})" == "origin/main" ]; then
echo "IS_MAIN=true" >> $GITHUB_ENV
else
echo "IS_MAIN=false" >> $GITHUB_ENV
fi

- name: Configure AWS credentials
if: env.IS_MAIN == 'true'
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::024209611402:role/github-action-role
aws-region: ap-south-1

- name: Login to Amazon ECR
if: env.IS_MAIN == 'true'
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2

- name: Build and Push Docker Image
if: env.IS_MAIN == 'true'
env:
REGISTRY: ${{ steps.login-ecr.outputs.registry }}
REPOSITORY: ${{ github.event.repository.name }}-repo
TAG: ${{ github.ref_name }}
run: |
docker build -t $REGISTRY/$REPOSITORY:$TAG ./backend
docker push $REGISTRY/$REPOSITORY:$TAG

- name: Deploy to ECS
if: env.IS_MAIN == 'true'
run: |
aws ecs update-service \
--cluster ${{ github.event.repository.name }}-cluster \
--service ${{ github.event.repository.name }}-service \
--force-new-deployment
44 changes: 44 additions & 0 deletions .github/workflows/cd-staging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Deploy AI Platform to ECS

on:
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

permissions:
packages: write
contents: read
attestations: write
id-token: write


steps:
- name: checkout the repo
uses: actions/checkout@v4

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4 # More information on this action can be found below in the 'AWS Credentials' section
with:
role-to-assume: arn:aws:iam::024209611402:role/github-action-role
aws-region: ap-south-1

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2


- name: Build and Push Docker Image
env:
REGISTRY: ${{ steps.login-ecr.outputs.registry }}
REPOSITORY: ${{ github.event.repository.name }}-staging-repo
run: |
docker build -t $REGISTRY/$REPOSITORY:latest ./backend
docker push $REGISTRY/$REPOSITORY:latest

- name: Deploy to ECS
run: |
aws ecs update-service --cluster ${{ github.event.repository.name }}-staging-cluster --service ${{ github.event.repository.name }}-staging-service --force-new-deployment
32 changes: 0 additions & 32 deletions .github/workflows/deploy-production.yml

This file was deleted.

32 changes: 0 additions & 32 deletions .github/workflows/deploy-staging.yml

This file was deleted.

61 changes: 0 additions & 61 deletions .github/workflows/generate-client.yml

This file was deleted.

47 changes: 0 additions & 47 deletions .github/workflows/issue-manager.yml

This file was deleted.

33 changes: 0 additions & 33 deletions .github/workflows/labeler.yml

This file was deleted.

40 changes: 0 additions & 40 deletions .github/workflows/latest-changes.yml

This file was deleted.

Loading
Loading