From e39d3422e6b43d274d1cfc5fd4bae1a0209922fe Mon Sep 17 00:00:00 2001 From: DEENUU1 Date: Mon, 1 Jan 2024 20:30:31 +0100 Subject: [PATCH] Create buildpsec.yml to install and zip libs --- .github/workflows/lambda.yml | 13 +++++++++++++ buildspec.yml | 20 ++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 .github/workflows/lambda.yml create mode 100644 buildspec.yml 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