Skip to content

aptos-labs/gce-github-runner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gce-github-runner

Pre-commit Test

Ephemeral GCE GitHub self-hosted runner.

Usage

jobs:
  create-runner:
    runs-on: ubuntu-latest
    outputs:
      label: ${{ steps.create-runner.outputs.label }}
    steps:
      - id: create-runner
        uses: related-sciences/gce-github-runner@v0.1
        with:
          token: ${{ secrets.GH_SA_TOKEN }}
          project_id: ${{ secrets.GCP_PROJECT_ID }}
          service_account_key: ${{ secrets.GCP_SA_KEY }}

  test:
    needs: create-runner
    runs-on: ${{ needs.create-runner.outputs.label }}
    steps:
      - run: echo "This runs on the GCE VM"
      - uses: related-sciences/gce-github-runner@v0.1
        with:
          command: stop
        if: always()
  • create-runner creates the GCE VM and registers the runner with unique label
  • test uses the runner, and destroys it as the last step

Inputs

Name Required Default Description
command True start start or stop of the runner.
token True GitHub auth token, needs repo/public_repo scope: https://docs.github.com/en/rest/reference/actions#self-hosted-runners.
project_id True ID of the Google Cloud Platform project. If provided, this will configure gcloud to use this project ID.
service_account_key True The service account key which will be used for authentication credentials. This key should be created and stored as a secret. Should be JSON key.
runner_ver True 2.278.0 Version of the GitHub Runner.
machine_zone True us-east1-c GCE zone.
machine_type True n1-standard-4 GCE machine type: https://cloud.google.com/compute/docs/machine-types
disk_size True 100g VM disk size.
runner_service_account False Service account of the VM, defaults to default compute service account.
scopes True cloud-platform Scopes granted to the VM.
shutdown_timeout True 30 Grace period for the stop command, in seconds.

Example Workflows

About

Ephemeral GCE/GCP GitHub self-hosted runner

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 100.0%