
CodeBuild Meets GitHub Actions: A Serverless CI Workflow with Lambda
Serverless GitHub Actions? Yes! Learn how to use AWS Lambda/ CodeBuild for Github Actions workflow execution.
- An AWS account with permissions to create CodeBuild projects and Lambda functions
- A GitHub repository where you want to run the actions
- AWS CLI and GitHub CLI installed on your local machine
- An IAM role with necessary permissions for CodeBuild and Lambda execution
- Open the AWS CodeBuild Console
- Click Create build project
- Project Name:
github-actions-runner
- Description:
Self-hosted GitHub Actions runner using AWS CodeBuild Lambda Runner

- Source: Select GitHub and connect to your repository

- Environment Image: Choose Managed Image
- Operating System: Amazon Linux 2
- Runtime: AWS Lambda
- Compute Type: Lambda Execution Environment
- Operating System System: Amazon Linux
- Runtime: Python
- Image & Version: Select the latest

- Choose New Service Role or select an existing role with permissions to execute CodeBuild, interact with GitHub, and access AWS Lambda.

- Attach the following policies if needed:
- Navigate to your GitHub repository
- Go to
Actions
tab and create a simple workflow. - To point the lambda self-hosted runner in place, update your
.github/workflows/main.yml
to use it: Please note theruns-on:
section here that you need to at to the workflow file.



- Reserved Capacity
- Caching Across Builds
- Restricting Runtime with Timeouts
- Tools Requiring Root-User Permissions
- Long-Running Builds (Lambda has a maximum timeout of 15 minutes)