Skip to content

Commit

Permalink
Updating start-aws-runner-action to fetch the latest AMI (#21475)
Browse files Browse the repository at this point in the history
* Update action.yml

* Update action.yml
  • Loading branch information
Mykyta-Serbynevskyi authored Jan 18, 2023
1 parent 4ade1da commit 2b4f0aa
Showing 1 changed file with 14 additions and 2 deletions.
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

0 comments on commit 2b4f0aa

Please sign in to comment.