Skip to content

GitHub Action

Py Lambda Deploy

v0.0.2 Latest version
Use latest version

Py Lambda Deploy

Deploy python code to AWS Lambda with dependencies in a separate layer


Copy and paste the following snippet into your .yml file.

- name: Py Lambda Deploy
  uses: mariamrf/py-lambda-action@v0.0.2
Learn more about this action in mariamrf/py-lambda-action
Choose a version



A Github Action to deploy AWS Lambda functions written in Python with their dependencies in a separate layer. For now, only works with Python 3.6.


Doesn't take any arguments. Deploys everything in the repo as code to the Lambda function, and installs/zips/deploys the dependencies as a separate layer the function can then immediately use.


  • Lambda code should be structured normally/as Lambda would expect it.
  • Dependencies must be stored in a requirements.txt.

Environment variables

Stored as secrets or env vars, doesn't matter. But also please don't put your AWS keys outside Secrets.

  • AWS Credentials
    That includes the AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, etc. It's used by awscli, so the docs for that can be found here.
    The ARN for the Lambda layer the dependencies should be pushed to without the version (every push is a new version).
    The Lambda function name. From the AWS docs, it can be any of the following:
    • Function name - my-function
    • Function ARN - arn:aws:lambda:us-west-2:123456789012:function:my-function
    • Partial ARN - 123456789012:function:my-function

Example workflow

workflow "Build & deploy" {
  on = "push"
  resolves = ["py-lambda-deploy"]

action "py-lambda-deploy" {
  needs = "Master"
  uses = "mariamrf/py-lambda-action@master"
  secrets = [

# Filter for master branch
action "Master" {
  uses = "actions/bin/filter@master"
  args = "branch master"
You can’t perform that action at this time.