AWS lambda auto deployment for node.js12 #173458
-
Why are you starting this discussion?Question What GitHub Actions topic or product is this about?Misc Discussion DetailsHow can I set up auto deployment for an AWS Lambda function running on Node.js 12? Should I use AWS CLI, SAM, or the Serverless Framework? How do I integrate deployment into CI/CD (like GitHub Actions or CodePipeline)? What’s the simplest setup for small projects vs. production-scale apps? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
Option 1: Using AWS CLI + GitHub Actions If you want something lightweight, you can combine the AWS CLI with a CI/CD tool like GitHub Actions.
on: jobs: Good Luck. |
Beta Was this translation helpful? Give feedback.
Option 1: Using AWS CLI + GitHub Actions
If you want something lightweight, you can combine the AWS CLI with a CI/CD tool like GitHub Actions.
aws lambda update-function-code
--function-name myLambdaFunction
--zip-file fileb://function.zip
name: Deploy to Lambda
on:
push:
branches: [ main ]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: npm install
- run: zip -r function.zip .
- run: aws lambda update-function-code
--function-name myLambdaFunction
--zip-file fileb://function.zip
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_A…