Skip to content
Discussion options

You must be logged in to vote

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.

  1. Write your Lambda function (index.js)
  2. Zip your code
  3. Deploy with AWS CLI:
    aws lambda update-function-code
    --function-name myLambdaFunction
    --zip-file fileb://function.zip
  4. Automate with GitHub Actions (.github/workflows/deploy.yml):
    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…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by puffer-git
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Actions Build, test, and automate your deployment pipeline with world-class CI/CD Question Ask and answer questions about GitHub features and usage Misc General discussions about GitHub Actions that don't fit other found themes.
2 participants