0.0.4 • Published 3 years ago
@cloudgardener/cdk-aws-fargate-github-runner v0.0.4
cdk-aws-fargate-github-runner
CDK construct library to deploy GitHub Actions self-hosted runner to AWS Fargate.
This is continuation to cdk-github-actions-runner
proof-of-concept.
Example
import { App, Stack } from "@aws-cdk/core";
import { GithubActionsRunner } from "@cloudgardener/cdk-aws-fargate-github-runner";
const app = new App();
const stack = new Stack(app, "stack");
// Get GitHub token e.g. from SSM Parameter Store
const token = Secret.fromSsmParameter(
StringParameter.fromSecureStringParameterAttributes(
this,
"GitHubAccessToken",
{
parameterName: "GITHUB_ACCESS_TOKEN",
version: 0,
}
)
);
// Assign runner to repository
const context = "https://github.com/cloudgardener/runner-demo";
// Runners can be also assigned to organization
// const context = "https://github.com/cloudgardener";
// Deploy the runner
new GithubActionsRunner(stack, "runner", {
githubToken: token,
runnerContext: context,
});