Skip to content

Merge pull request #15 from Prithwi32/feature/InvalidInputHandling #5

Merge pull request #15 from Prithwi32/feature/InvalidInputHandling

Merge pull request #15 from Prithwi32/feature/InvalidInputHandling #5

Workflow file for this run

name: CI
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.12'
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install pylint pytest pytest-flask flask-socketio flask-cors pymongo redis
- name: Lint Code
run: |
pylint . || true
- name: Login to Amazon ECR
uses: aws-actions/amazon-ecr-login@v2
env:
AWS_REGION: ${{ secrets.AWS_REGION }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- name: Build and Push Backend Docker Image
env:
IMAGE_TAG: ${{ github.sha }} # Using commit SHA as image tag
run: |
BACKEND_IMAGE_URI="${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.${{ secrets.AWS_REGION }}.amazonaws.com/${{ secrets.BACKEND_ECR }}:${{ env.IMAGE_TAG }}"
docker build -t $BACKEND_IMAGE_URI -f ./Dockerfile ./
docker push $BACKEND_IMAGE_URI
- name: Build and Push Frontend Docker Image
env:
IMAGE_TAG: ${{ github.sha }} # Using commit SHA as image tag
run: |
FRONTEND_IMAGE_URI="${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.${{ secrets.AWS_REGION }}.amazonaws.com/${{ secrets.FRONTEND_ECR }}:${{ env.IMAGE_TAG }}"
docker build -t $FRONTEND_IMAGE_URI -f ./frontend/Dockerfile ./frontend
docker push $FRONTEND_IMAGE_URI