forked from LedgerHQ/ledger-live
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move actions and reusable workflows in this project
- Loading branch information
1 parent
a41da9b
commit 88492c8
Showing
55 changed files
with
1,273 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
name: Start self-hosted EC2 runner (Linux) | ||
on: | ||
workflow_call: | ||
inputs: | ||
instance-type: | ||
description: name of runner to use | ||
required: false | ||
type: string | ||
default: t3.medium | ||
# c5.4xlarge | ||
secrets: | ||
CI_BOT_TOKEN: | ||
required: true | ||
outputs: | ||
label: | ||
description: name of runner to use | ||
value: ${{ jobs.start-runner.outputs.label }} | ||
ec2-instance-id: | ||
description: ec2 instance id | ||
value: ${{ jobs.start-runner.outputs.ec2-instance-id }} | ||
env: | ||
AWS_REGION: eu-west-1 | ||
|
||
jobs: | ||
start-runner: | ||
name: start self-hosted EC2 runner | ||
runs-on: [ledger-live, linux] | ||
outputs: | ||
label: ${{ steps.start-ec2-runner.outputs.label }} | ||
ec2-instance-id: ${{ steps.start-ec2-runner.outputs.ec2-instance-id }} | ||
steps: | ||
- name: get latest LLD runner AMI id | ||
id: get-ami-id | ||
run: | | ||
echo "::set-output name=ami-id::$(aws ec2 describe-images --filters 'Name=name,Values=ledger-live-runner' --query 'Images[*].ImageId' --output text)" | ||
- name: start EC2 runner | ||
id: start-ec2-runner | ||
uses: skyzh/ec2-github-runner@ba2298a67875dfdd29a88fafbc1ba27f4f94af39 | ||
with: | ||
mode: start | ||
github-token: ${{ secrets.CI_BOT_TOKEN }} | ||
ec2-image-id: ${{ steps.get-ami-id.outputs.ami-id }} | ||
ec2-instance-type: ${{ inputs.instance-type }} | ||
subnet-id: subnet-0eeb962bb7d9d96ef # production-shared-private-eu-west-1a | ||
security-group-id: sg-010daba499648d1e7 # infra-gha-runner-sg | ||
aws-resource-tags: > # optional, requires additional permissions | ||
[ | ||
{"Key": "Name", "Value": "ec2-github-runner"}, | ||
{"Key": "GitHubRepository", "Value": "${{ github.repository }}"} | ||
] | ||
- name: get volume-id | ||
id: get-volume-id | ||
run: | | ||
echo "::set-output name=volume-id::$(aws ec2 describe-instances --instance-ids ${{ steps.start-ec2-runner.outputs.ec2-instance-id }} --query 'Reservations[*].Instances[*].BlockDeviceMappings[*].Ebs.VolumeId' --output text)" | ||
- name: resize rootfs | ||
env: | ||
VOLUME_ID: ${{ steps.get-volume-id.outputs.volume-id }} | ||
run: | | ||
aws ec2 modify-volume --size 30 --volume-id $VOLUME_ID |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Stop self-hosted EC2 runner (Linux) | ||
on: | ||
workflow_call: | ||
secrets: | ||
CI_BOT_TOKEN: | ||
required: true | ||
inputs: | ||
label: | ||
description: name of runner to use | ||
required: true | ||
type: string | ||
ec2-instance-id: | ||
description: ec2 instance id | ||
required: true | ||
type: string | ||
env: | ||
AWS_REGION: eu-west-1 | ||
|
||
jobs: | ||
stop-runner: | ||
name: stop self-hosted EC2 runner | ||
runs-on: [ledger-live, linux] | ||
if: ${{ always() }} | ||
steps: | ||
- name: Stop EC2 runner | ||
uses: machulav/ec2-github-runner@v2 | ||
with: | ||
mode: stop | ||
github-token: ${{ secrets.CI_BOT_TOKEN }} | ||
label: ${{ inputs.label }} | ||
ec2-instance-id: ${{ inputs.ec2-instance-id }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -101,7 +101,7 @@ jobs: | |
- uses: ledgerhq/actions/[email protected] | ||
id: version | ||
- name: set beta name | ||
uses: ledgerhq/actions/packages/change-product-name@main | ||
uses: ledgerhq/ledger-live/tools/actions/change-product-name@monorepo-setup | ||
with: | ||
path: ${{ github.workspace }} | ||
- name: Get short SHA | ||
|
@@ -153,7 +153,7 @@ jobs: | |
- uses: ledgerhq/actions/[email protected] | ||
id: version | ||
- name: set beta name | ||
uses: ledgerhq/actions/packages/change-product-name@main | ||
uses: ledgerhq/ledger-live/tools/actions/change-product-name@monorepo-setup | ||
with: | ||
path: ${{ github.workspace }} | ||
- name: Get short SHA | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.