diff --git a/.github/workflows/test-deploy.yml b/.github/workflows/test-deploy.yml new file mode 100644 index 0000000..a48f8e9 --- /dev/null +++ b/.github/workflows/test-deploy.yml @@ -0,0 +1,43 @@ +name: Deploy Python Lambda to AWS (from src) + +on: + push: + branches: + - test-deploy + +jobs: + deploy_lambda: + runs-on: ubuntu-latest + permissions: + id-token: write + contents: read + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.12' + + - name: Install dependencies + run: | + pip install -r requirements.txt -t ./src + + - name: Zip deployment package + run: | + cd src + zip -r ../deployment-package.zip . + + - name: Configure AWS Credentials (OIDC) + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: ${{ secrets.AWS_ROLE_ARN }} + aws-region: us-west-2 + + - name: Deploy to AWS Lambda + run: | + aws lambda update-function-code \ + --function-name analyzeTermOfServicesTest \ + --zip-file fileb://deployment-package.zip \ No newline at end of file