diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..57d6427 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,30 @@ +name: Deploy to AWS Lambda + +on: + push: + branches: + - main + +jobs: + deploy: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.10' + + - name: Install dependencies + run: | + pip install -r requirements.txt + + - name: Deploy to AWS Lambda + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + run: | + zappa update dev diff --git a/requirements.txt b/requirements.txt index 5ef2f61..e664129 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,4 @@ Flask==3.0.0 requests python-dotenv +zappa \ No newline at end of file diff --git a/zappa_settings.json b/zappa_settings.json new file mode 100644 index 0000000..fb165e6 --- /dev/null +++ b/zappa_settings.json @@ -0,0 +1,10 @@ +{ + "dev": { + "app_function": "app.app", + "aws_region": "us-east-2", + "profile_name": "default", + "project_name": "star-spotter-api", + "runtime": "python3.10", + "s3_bucket": "star-spotter" + } +} \ No newline at end of file