Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating start-aws-runner-action to fetch the latest AMI #21475

Merged
Merged
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
16 changes: 14 additions & 2 deletions .github/actions/start-aws-runner/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ inputs:
github-token:
required: true
ec2-image-id:
# https://internal-docs.airbyte.io/Things-To-Know/Build-Runner-Images#ami-017f6fe645968f7e0
# https://internal-docs.airbyte.io/Things-To-Know/Build-Runner-Images
default: "ami-017f6fe645968f7e0"
required: true
ec2-instance-type:
Expand Down Expand Up @@ -40,13 +40,25 @@ runs:
aws-access-key-id: ${{ inputs.aws-access-key-id }}
aws-secret-access-key: ${{ inputs.aws-secret-access-key }}
aws-region: us-east-2

- name: Get a latest AMI id
id: get-ami-id
shell: bash
run: |-
echo "latest_ami_id=$(aws ec2 describe-images --owners "self" \
--region "us-east-2" \
--filters "Name=name,Values=github-runner*" \
--filters "Name=state,Values=available" \
--query "sort_by(Images, &CreationDate)[-1].ImageId" \
--output text)" >> $GITHUB_OUTPUT

- name: Start EC2 runner
id: start-ec2-runner
uses: airbytehq/ec2-github-runner@MSGv0.0.2
with:
mode: start
github-token: ${{ inputs.github-token }}
ec2-image-id: ${{ inputs.ec2-image-id }}
ec2-image-id: ${{ steps.get-ami-id.outputs.latest_ami_id }}
ec2-instance-type: ${{ inputs.ec2-instance-type }}
subnet-id: ${{ inputs.subnet-id }}
security-group-id: ${{ inputs.security-group-id }}
Expand Down