- Architecture Overview and Infrastructure Components
- ECR Runner Image Repository
- Self-hosted GitHub Runner(s) Registration Token
- Hosting the Runner Docker Artifacts on CodeCommit
- Build/Push Runner Image using CodeBuild
- Scalable ECS Cluster
- EventBus and Schema Discover for Webhook Events
- ECS Runner Task Definition
- Lambda Function URL
- GitHub Webhook
- EventBridge Rule
- Testing the Final Infrastructure
The naming convention and tagging standards used for the ECR runner image(s) repositories are site-specific. To keep things simple, the assumption is we are planning for on a single runner type—Debian Linux, x64 architecture.
Create an ECR private repository github-actions-self-hosted-runner-debian:
aws --profile admin_profile ecr create-repository \
    --repository-name github-actions-self-hosted-runner-debian \
    --region us-east-1Sample output:
{
    "repository": {
        "repositoryArn": "arn:aws:ecr:us-east-1:xxxxxxxxxxxx:repository/github-actions-self-hosted-runner-debian",
        "registryId": "xxxxxxxxxxxx",
        "repositoryName": "github-actions-self-hosted-runner-debian",
        "repositoryUri": "xxxxxxxxxxxx.dkr.ecr.us-east-1.amazonaws.com/github-actions-self-hosted-runner-debian",
        "createdAt": "2023-01-07T05:31:56+00:00",
        "imageTagMutability": "MUTABLE",
        "imageScanningConfiguration": {
            "scanOnPush": false
        },
        "encryptionConfiguration": {
            "encryptionType": "AES256"
        }
    }
}From the above, the repository URI is: xxxxxxxxxxxx.dkr.ecr.us-east-1.amazonaws.com/github-actions-self-hosted-runner-debian.
