Skip to content

Latest commit

 

History

History
43 lines (33 loc) · 1.29 KB

README.md

File metadata and controls

43 lines (33 loc) · 1.29 KB

gce-github-runner

Ephemeral GCE GitHub self-hosted runner based on https://github.com/related-sciences/gce-github-runner

For more context see Running Github runners in GCE VMs

Usage

jobs:
  create-runner:
    uses: gitpod-io/gce-github-runner/.github/workflows/create-vm.yml@secrets
    secrets:
      runner_token: ${{ secrets.GH_SA_TOKEN }}
      gcp_credentials: ${{ secrets.GCP_SA_KEY }}

  test:
    needs: [create-runner]
    runs-on: ${{ needs.create-runner.outputs.label }}
    steps:
      - run: echo "This runs on the GCE VM"

  delete-runner:
    if: always()
    needs:
      - create-runner
      - test
    uses: gitpod-io/gce-github-runner/.github/workflows/delete-vm.yml@secrets
    secrets:
      gcp_credentials: ${{ secrets.GCP_SA_KEY }}
    with:
      runner-label: ${{ needs.create-runner.outputs.label }}
      machine-zone: ${{ needs.create-runner.outputs.machine-zone }}
  • create-runner creates the GCE VM and registers the runner with unique label
  • test uses the runner
  • delete-runner waits for the end of the steps execution and then shutdowns the GCE VM, removing the runner from the GitHub runner

Inputs

See inputs and descriptions here.