Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,9 @@ Now you're ready to go!
| `ec2-instance-type` | Required if you use the `start` mode. | EC2 Instance Type. |
| `subnet-id` | Required if you use the `start` mode. | VPC Subnet Id. <br><br> The subnet should belong to the same VPC as the specified security group. |
| `security-group-id` | Required if you use the `start` mode. | EC2 Security Group Id. <br><br> The security group should belong to the same VPC as the specified subnet. <br><br> Only the outbound traffic for port 443 should be allowed. No inbound traffic is required. |
| `key-name` | Required if you use the `start` mode. | EC2 Key Pair name. <br><br> Can be assigned to the EC2 instance so user can SSH in for debuging. |
| `storage-path` | Required if you use the `start` mode. | EC2 Block Storage Volume. <br><br> Used for configuring the mount path of the volume if you're overriding the default volume size of the EC2 instance. The parameter `storage-size` must also be configured when using this parameter. |
| `storage-size` | Required if you use the `start` mode. | EC2 Block Storage Volume. <br><br> Used for overriding volume size of the machine if your project exceed the 8GiB default storage. The parameter `storage-path` must also be configured when using this parameter. |
| `label` | Required if you use the `stop` mode. | Name of the unique label assigned to the runner. <br><br> The label is provided by the output of the action in the `start` mode. <br><br> The label is used to remove the runner from GitHub when the runner is not needed anymore. |
| `ec2-instance-id` | Required if you use the `stop` mode. | EC2 Instance Id of the created runner. <br><br> The id is provided by the output of the action in the `start` mode. <br><br> The id is used to terminate the EC2 instance when the runner is not needed anymore. |
| `iam-role-name` | Optional. Used only with the `start` mode. | IAM role name to attach to the created EC2 runner. <br><br> This allows the runner to have permissions to run additional actions within the AWS account, without having to manage additional GitHub secrets and AWS users. <br><br> Setting this requires additional AWS permissions for the role launching the instance (see above). |
Expand Down
17 changes: 17 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,23 @@ inputs:
The runner doesn't require any inbound traffic. However, outbound traffic should be allowed.
This input is required if you use the 'start' mode.
required: false
key-name:
description: >-
EC2 Key Pair name.
Can be assigned to the EC2 instance so user can SSH in for debuging.
required: false
storage-path:
description: >-
EC2 Block Storage Volume.
Used for configuring the mount path of the volume if you're overriding the default volume size of the EC2 instance.
The parameter `storage-size` must also be configured when using this parameter.
required: false
storage-size:
description: >-
EC2 Block Storage Volume.
Used for overriding volume size of the machine if your project exceed the 8GiB default storage.
The parameter `storage-path` must also be configured when using this parameter.
required: false
label:
description: >-
Name of the unique label assigned to the runner.
Expand Down
11 changes: 11 additions & 0 deletions src/aws.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,17 @@ async function startEc2Instance(label, githubRegistrationToken) {
SecurityGroupIds: [config.input.securityGroupId],
IamInstanceProfile: { Name: config.input.iamRoleName },
TagSpecifications: config.tagSpecifications,
KeyName: config.keyName,
BlockDeviceMappings: [
{
DeviceName: config.storagePath,
Ebs: {
DeleteOnTermination: true,
VolumeSize: config.storageSize,
},
},
],

};

try {
Expand Down
3 changes: 3 additions & 0 deletions src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ class Config {
ec2InstanceType: core.getInput('ec2-instance-type'),
subnetId: core.getInput('subnet-id'),
securityGroupId: core.getInput('security-group-id'),
keyName: core.getInput('key-name'),
storagePath: core.getInput('storage-path'),
storageSize: core.getInput('storage-size'),
label: core.getInput('label'),
ec2InstanceId: core.getInput('ec2-instance-id'),
iamRoleName: core.getInput('iam-role-name'),
Expand Down