Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yc-actions/yc-github-runner
On-demand self-hosted Yandex Cloud runner for GitHub Actions
https://github.com/yc-actions/yc-github-runner
actions github github-actions runner yandex-cloud
Last synced: about 1 month ago
JSON representation
On-demand self-hosted Yandex Cloud runner for GitHub Actions
- Host: GitHub
- URL: https://github.com/yc-actions/yc-github-runner
- Owner: yc-actions
- License: mit
- Created: 2023-01-10T16:05:43.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-11-25T19:39:19.000Z (about 1 month ago)
- Last Synced: 2024-11-25T20:29:27.562Z (about 1 month ago)
- Topics: actions, github, github-actions, runner, yandex-cloud
- Language: TypeScript
- Homepage:
- Size: 20.6 MB
- Stars: 17
- Watchers: 3
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## GitHub Action to On-demand self-hosted YC runner for GitHub Actions.
Start your Yandex Cloud self-hosted runner right before you need it. Run the job on it. Finally, stop it when you
finish. And all this automatically as a part of your GitHub Actions workflow.**Table of Contents**
- [Usage](#usage)
- [Permissions](#permissions)
- [License Summary](#license-summary)## Usage
```yaml
name: do-the-job
on: pull_request
jobs:
start-runner:
name: Start self-hosted YC runner
runs-on: ubuntu-latest
outputs:
label: ${{ steps.start-yc-runner.outputs.label }}
instance-id: ${{ steps.start-yc-runner.outputs.instance-id }}
steps:
- name: Start YC runner
id: start-yc-runner
uses: yc-actions/yc-github-runner@v1
with:
mode: start
yc-sa-json-credentials: ${{ secrets.YC_SA_JSON_CREDENTIALS }}
github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
folder-id: b1g*********
image-id: fd80*********
cores: 2
memory: 2GB
core-fraction: 100
subnet-id: e9b*********
ttl: PT24H
do-the-job:
name: Do the job on the runner
needs: start-runner # required to start the main job when the runner is ready
runs-on: ${{ needs.start-runner.outputs.label }} # run the job on the newly created runner
steps:
- name: Hello World
run: echo 'Hello World!'
stop-runner:
name: Stop self-hosted YC runner
needs:
- start-runner # required to get output from the start-runner job
- do-the-job # required to wait when the main job is done
runs-on: ubuntu-latest
if: ${{ always() }} # required to stop the runner even if the error happened in the previous jobs
steps:
- name: Stop YC runner
uses: yc-actions/yc-github-runner@v1
with:
mode: stop
yc-sa-json-credentials: ${{ secrets.YC_SA_JSON_CREDENTIALS }}
github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
label: ${{ needs.start-runner.outputs.label }}
instance-id: ${{ needs.start-runner.outputs.instance-id }}
```See [action.yml](action.yml) for the full documentation for this action's inputs and outputs.
### TTL input
If it is set, `expires` label will be added to the instance with the value of the current time plus TTL in seconds.
Instance won't automatically be destroyed by Yandex.Cloud, you should handle it yourself.
For example, by using Cron trigger that will call Cloud Function to destroy the instance.## Permissions
To perform this action, it is required that the service account on behalf of which we are acting has granted
the `compute.admin` role or greater.## License Summary
This code is made available under the MIT license.