This repository was archived by the owner on Nov 26, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 58
47 lines (38 loc) · 1.43 KB
/
deploy.yml
File metadata and controls
47 lines (38 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: Deploy to AWS Lambda
on:
push:
branches:
- master
- development
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 20
- name: Install dependencies
run: npm ci
- name: Package Lambda function
run: |
zip -r ./function.zip ./catalog-emit-consumer/.
- 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: ${{ vars.AWS_REGION }}
- name: Update Lambda environment variables
env:
MONGO_URI: ${{ secrets.MONGO_URI }}
AWS_SQS_QUEUE_URL: ${{ vars.AWS_SQS_QUEUE_URL }}
AWS_S3_BUCKET: ${{ vars.AWS_S3_BUCKET }}
run: |
aws lambda update-function-configuration --function-name catalog-emit-consumer --environment Variables="{MONGO_URI=$MONGO_URI,AWS_SQS_QUEUE_URL=$AWS_SQS_QUEUE_URL,AWS_S3_BUCKET=$AWS_S3_BUCKET}"
- name: Deploy to AWS Lambda
run: |
aws s3 cp function.zip s3://ifood-product-catalog-bucket
aws lambda update-function-code --function-name catalog-emit-consumer --s3-bucket ifood-product-catalog-bucket --s3-key function.zip