updating handler #16
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |