Skip to content

Commit

Permalink
Merge pull request #35 from sudeeppr1998/main
Browse files Browse the repository at this point in the history
Merging ALL 1.0 Changes to Main
  • Loading branch information
sudeeppr1998 authored Apr 26, 2024
2 parents f17e9ee + 366eade commit bc519e5
Show file tree
Hide file tree
Showing 18 changed files with 20,259 additions and 558 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ jobs:
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

-
name: Load .env from GitHub Secret
run: echo "${{ secrets.MY_ENV_VARS }}" > .env

-
name: Build and push
uses: docker/build-push-action@v2
Expand All @@ -30,7 +30,7 @@ jobs:
push: true
tags: ${{ secrets.CONTAINER_REGISTRY }}:${{ secrets.IMAGE_TAG }}
env:
MY_ENV_VARS: ${{ secrets.MY_ENV_VARS }}
MY_ENV_VARS: ${{ secrets.MY_ENV_VARS }}
deploy:
runs-on: ubuntu-latest
timeout-minutes: 15
Expand All @@ -39,7 +39,7 @@ jobs:
-
name: Checkout
uses: actions/checkout@v2
-
-
name: Deploy Stack
uses: appleboy/ssh-action@master
with:
Expand All @@ -48,11 +48,11 @@ jobs:
key: ${{ secrets.SSH_PRIVATE_KEY }}
port: ${{ secrets.PORT }}
script: |
docker login
docker container stop ${{ secrets.CONTAINER_NAME }}
docker rm ${{ secrets.CONTAINER_NAME }}
docker rmi ${{ secrets.CONTAINER_REGISTRY }}:${{ secrets.IMAGE_TAG }}
docker pull ${{ secrets.CONTAINER_REGISTRY }}:${{ secrets.IMAGE_TAG }}
Expand Down
60 changes: 60 additions & 0 deletions .github/workflows/prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: PROD DEPLOYMENT

on:
push:
branches: [ all-1.0-prod ]

jobs:
build:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
-
name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

-
name: Load .env from GitHub Secret
run: echo "${{ secrets.MY_ENV_VARS_PROD }}" > .env

-
name: Build and push
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: ${{ secrets.CONTAINER_REGISTRY_PROD }}:${{ secrets.IMAGE_TAG }}
env:
MY_ENV_VARS: ${{ secrets.MY_ENV_VARS_PROD }}
deploy:
runs-on: ubuntu-latest
timeout-minutes: 15
needs: [build]
steps:
-
name: Checkout
uses: actions/checkout@v2
-
name: Deploy Stack
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST_PROD }}
username: ${{ secrets.USERNAME_PROD }}
key: ${{ secrets.SSH_PRIVATE_KEY_PROD }}
port: ${{ secrets.PORT }}
script: |
docker login
docker container stop ${{ secrets.CONTAINER_NAME }}
docker rm ${{ secrets.CONTAINER_NAME }}
docker rmi ${{ secrets.CONTAINER_REGISTRY_PROD }}:${{ secrets.IMAGE_TAG }}
docker pull ${{ secrets.CONTAINER_REGISTRY_PROD }}:${{ secrets.IMAGE_TAG }}
cd /home/azureuser/all-services/all-learner-ai-services
docker-compose up -d --force-recreate --no-deps
10 changes: 0 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,6 @@ RUN npm install
# Copy the rest of the application code to the container
COPY . .

# Set environment variables
ENV DATABASE=mongodb
ENV PORT=3001
ENV MONGO_URL=
ENV MYSQL_HOST=
ENV MYSQL_PORT=
ENV MYSQL_USERNAME=
ENV MYSQL_PASSWORD=
ENV MYSQL_DATABASE=

# Expose the port on which the application will run
EXPOSE $PORT

Expand Down
46 changes: 46 additions & 0 deletions coderabbit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
language: "en"

early_access: false

reviews:
request_changes_workflow: true
high_level_summary: true
poem: false
review_status: true
collapse_walkthrough: false
path_filters:
- "!**/.xml"
path_instructions:
- path: "**/*.css"
instructions: |
"Review the CSS code against the google css style guide and point out any mismatches. Ensure that:
- The code adheres to best practices associated with CSS.
- The code adheres to best practices recommended by lighthouse or similar tools for performance.
- The code adheres to similar naming conventions for classes, ids."
- path: "**/*.html"
instructions: |
"Review the HTML code against the google html style guide and point out any mismatches. Ensure that:
- The code adheres to best practices recommended by lighthouse or similar tools for performance."
- path: "**/*.js,**/*.ts"
instructions: |
"Review the JAVASCRIPT code against the google javascript style guide and point out any mismatches. Ensure that:
- The code adheres to best practices associated with React.
- The code adheres to best practices associated with React PWA.
- The code adheres to best practices associated with SPA.
- The code adheres to best practices recommended by lighthouse or similar tools for performance.
- The code adheres to similar naming conventions for components, views, methods."
auto_review:
enabled: true
ignore_title_keywords:
- "WIP"
- "DO NOT MERGE"
drafts: false
base_branches:
- "master"
- "dev"
- "feat/*"
- "feat-*"
- "all-*"

chat:
auto_reply: true
24 changes: 24 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
version: '3'
services:
nestjs-app:
build:
context: .
ports:
- '3001:3001'
container_name: learner-ai
restart: always
networks:
- ai-network
environment:
- MONGO_URL=
- AI4BHARAT_API_KEY=
- AI4BHARAT_URL=
- SERVER_URL=
- ALL_CONTENT_SERVICE_API=
- ALL_TEXT_EVAL_API=
- PORT=3001
- DATABASE=mongodb

networks:
ai-network:
driver: bridge
Loading

0 comments on commit bc519e5

Please sign in to comment.