# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Python application

on:
  push:
    branches: 
      - master
      - main

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2
    - name: Set up Python 3.8
      uses: actions/setup-python@v2
      with:
        python-version: 3.8
    - name: Install dependencies
      run: |
        python -m pip install --upgrade pip
        pip install virtualenv
        virtualenv venv
        if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
    - name: Create ZIP
      run: |
        zip -j update-zestimate.zip functions/update-zestimate/main.py
        cd ./venv/lib/python3.8/site-packages; zip -r ../../../../update-zestimate.zip *
    - name: Configure AWS credentials
      uses: aws-actions/configure-aws-credentials@v1
      with:
        aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
        aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
        aws-region: us-west-2
    - name: Copy deployment ZIP to AWS
      run: |
        aws s3 cp update-zestimate.zip s3://${{ secrets.DEPLOY_BUCKET }}/${{ secrets.DEPLOY_PATH }}

# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Python application

on:
  push:
    branches: 
      - master
      - main

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2
    - name: Set up Python 3.8
      uses: actions/setup-python@v2
      with:
        python-version: 3.8
    - name: Install dependencies
      run: |
        python -m pip install --upgrade pip
        if [ -f requirements.txt ]; then pip install --target ./package -r requirements.txt; fi
    - name: Create ZIP
      run: |
        (cd package;zip -r update-zestimate.zip ./*)
        zip -gj package/update-zestimate.zip functions/update-zestimate/main.py
        mv package/update-zestimate.zip .
    - name: Configure AWS credentials
      uses: aws-actions/configure-aws-credentials@v1
      with:
        aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
        aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
        aws-region: us-west-2
    - name: Copy deployment ZIP to AWS
      run: |
        aws s3 cp update-zestimate.zip s3://${{ secrets.DEPLOY_BUCKET }}/${{ secrets.DEPLOY_PATH }}

Update how the deployment zip is built
Update how the deployment zip is built
