Skip to content

updating handler

updating handler #16

Workflow file for this run

name: Deploy AWS Lambda
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
id-token: write # Required for OIDC authentication
contents: read # Required to check out the repository
packages: read
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'npm'
- name: Install Task
uses: arduino/setup-task@v2
with:
version: 3.x
- name: Install dependencies
run: npm ci
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_PACKAGE_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build Lambda code
run: task build
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ vars.AWS_ROLE_ARN }}
aws-region: ${{ vars.AWS_REGION }}
- name: Deploy Lambda Function
run: |
aws lambda update-function-code \
--function-name ${{ vars.LAMBDA_FUNCTION_NAME }} \
--zip-file fileb://dist/lambda.zip
aws lambda update-function-configuration \
--function-name ${{ vars.LAMBDA_FUNCTION_NAME }} \
--handler index.quoteHandler \
--runtime nodejs22.x