diff --git a/.github/workflows/Deploy.yml b/.github/workflows/Deploy.yml new file mode 100644 index 0000000..0ad09b0 --- /dev/null +++ b/.github/workflows/Deploy.yml @@ -0,0 +1,37 @@ +name: Deploy to AWS Lambda + +on: + push: + branches: + - main + +jobs: + deploy: + runs-on: ubuntu-latest + environment: Preview + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.x' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + + - name: Package application + run: | + zip -r deployment_package.zip . + + - name: Deploy to AWS Lambda + uses: appleboy/lambda-action@v0.2.0 + with: + function_name: "dev-lta-datasets-updater" + zip-file: "deployment_package.zip" + aws_region: "ap-southeast-1" + aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}