diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index b3bd3e5..417b160 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -31,30 +31,4 @@ jobs: # AWS CLI command to update the backend service in AWS App Runner aws apprunner update-service \ --service-arn $(aws apprunner list-services --query "ServiceSummaryList[?ServiceName=='${{ secrets.APP_RUNNER_SERVICE_NAME_BACKEND }}'].ServiceArn | [0]" --output text) \ - --source-configuration SourceCodeRepository={"RepositoryUrl": "${{ secrets.REPOSITORY_URL_BACKEND }}", "SourceCodeVersion": {"Type": "BRANCH", "Value": "master"}} - - # Job for deploying the frontend service - deploy-frontend: - name: Deploy Frontend to AWS App Runner - runs-on: ubuntu-latest # Run on the latest version of Ubuntu - - steps: - # Step 1: Checkout the code from the repository - - name: Checkout code - uses: actions/checkout@v3 # GitHub Action to checkout the code - - # Step 2: Set up AWS CLI with necessary credentials - - name: Set up AWS CLI - uses: aws-actions/configure-aws-credentials@v2 # GitHub Action to configure AWS credentials - with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} # AWS Access Key ID stored as a GitHub secret - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} # AWS Secret Access Key stored as a GitHub secret - aws-region: ${{ secrets.AWS_REGION }} # AWS Region stored as a GitHub secret - - # Step 3: Deploy the frontend service to AWS App Runner - - name: Deploy Frontend - run: | - # AWS CLI command to update the frontend service in AWS App Runner - aws apprunner update-service \ - --service-arn $(aws apprunner list-services --query "ServiceSummaryList[?ServiceName=='${{ secrets.APP_RUNNER_SERVICE_NAME_FRONTEND }}'].ServiceArn | [0]" --output text) \ - --source-configuration SourceCodeRepository={"RepositoryUrl": "${{ secrets.REPOSITORY_URL_FRONTEND }}", "SourceCodeVersion": {"Type": "BRANCH", "Value": "master"}} \ No newline at end of file + --source-configuration SourceCodeRepository={"RepositoryUrl": "${{ secrets.REPOSITORY_URL_BACKEND }}", "SourceCodeVersion": {"Type": "BRANCH", "Value": "master"}} \ No newline at end of file diff --git a/Makefile b/Makefile index 1b50ef9..f4863dc 100644 --- a/Makefile +++ b/Makefile @@ -27,7 +27,7 @@ all: # ------------------------ # start-backend: - @fastapi dev 'linguaphoto/main.py' --port 8080 + @python 'linguaphoto/main.py' start-frontend: @cd frontend && npm start diff --git a/linguaphoto/main.py b/linguaphoto/main.py index edd087c..2893787 100644 --- a/linguaphoto/main.py +++ b/linguaphoto/main.py @@ -1,7 +1,7 @@ """Defines the main entrypoint for the FastAPI app.""" -from fastapi import FastAPI, Request, status import uvicorn +from fastapi import FastAPI, Request, status from fastapi.middleware.cors import CORSMiddleware from fastapi.responses import JSONResponse @@ -29,6 +29,7 @@ async def value_error_exception_handler(request: Request, exc: ValueError) -> JS async def root() -> dict[str, str]: return {"message": "Hello, World!"} + if __name__ == "__main__": print("Starting webserver...") - uvicorn.run(app, port=8080, host='0.0.0.0') + uvicorn.run(app, port=8080, host="0.0.0.0") diff --git a/linguaphoto/requirements-dev.txt b/linguaphoto/requirements-dev.txt index 3f08f1d..c8594b2 100644 --- a/linguaphoto/requirements-dev.txt +++ b/linguaphoto/requirements-dev.txt @@ -21,5 +21,5 @@ s3fs # Types types-requests -# AWS -localstack +# # AWS +# localstack