Whenever we push our codes to our branch, master
, using git action, this will automatically update our codes into our lambda function.
Under our main.yaml, we deploy lambda through the following codes:
- npx ncc build index.ts
- Compile our
index.ts
module into a single file, together with all its imported dependencies
- Compile our
zip -j deploy.zip ./dist/*
- Create a zip file named,
deploy.zip
with the compiled module built byncc
under./dist/*
- Create a zip file named,
- aws lambda update-function-code
- Update our function's codes directly to AWS lambda
aws lambda update-function-code --function-name=lambda-git-action --zip-file=fileb://deploy.zip