diff --git a/.github/workflows/lambda.yml b/.github/workflows/lambda.yml new file mode 100644 index 0000000..83895ec --- /dev/null +++ b/.github/workflows/lambda.yml @@ -0,0 +1,13 @@ +name: AWS Lambda Deploy + +on: + push: + branches: [main] + pull_request: + branches: [main] + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + env: diff --git a/buildspec.yml b/buildspec.yml new file mode 100644 index 0000000..8591c94 --- /dev/null +++ b/buildspec.yml @@ -0,0 +1,20 @@ +version: 0.2 +phases: + install: + runtime-versions: + python: 3.8 + commands: + - echo "Installing dependencies..." + - pip install -r requirements.txt -t lib + build: + commands: + - echo "Zipping deployment package..." + - cd lib + - zip -r9 ../deployment_package.zip . + - cd .. + - zip -g deployment_package.zip lambda_function.py + post_build: + commands: + - echo "Updating lambda Function..." + - aws lambda update-function-code --function-name fjob_scrapers --zip-file fileb://deployment_package.zip + - echo "DONE!!" \ No newline at end of file