Self-hosted GitHub Actions on ECS

How do Self-hosted GitHub Runners work?

Dockerisation

Environment Variables

Deploying to ECS

  • You have to put your docker hub credentials in AWS Secrets Manager to get around the rate limit funsies.
  • You have to put your GitHub PAT in SSM to make it securely available to the task
  • You need to spin up/deploy to a ECS cluster that can access GitHub and the outside world
  • You need to consider/setup your ECS Instance Role, Execution Role and Task Roles in IAM

Task Definition

GitHub Actions Settings

Testing with a workflow

It works! 🎉

curl 169.254.170.2$AWS_CONTAINER_CREDENTIALS_RELATIVE_URI{
"AccessKeyId": "ACCESS_KEY_ID",
"Expiration": "EXPIRATION_DATE",
"RoleArn": "TASK_ROLE_ARN",
"SecretAccessKey": "SECRET_ACCESS_KEY",
"Token": "SECURITY_TOKEN_STRING"
}

Considerations and wrap up

--

--

Climber and Software Engineer. Passionate about mountains (especially winter sports), software engineering, people and the trivia in-between.

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Type II Fun - The wafflings of Simon Mayes

Type II Fun - The wafflings of Simon Mayes

1 Follower

Climber and Software Engineer. Passionate about mountains (especially winter sports), software engineering, people and the trivia in-between.