Skip to content
rotate-cw

GitHub Action

metal-github-runner

v0.4.0 Latest version

metal-github-runner

rotate-cw

metal-github-runner

Provision an Equinix Metal Server and set up a github self-hosted runner on it

Installation

Copy and paste the following snippet into your .yml file.

              

- name: metal-github-runner

uses: equinix-labs/metal-runner-action@v0.4.0

Learn more about this action in equinix-labs/metal-runner-action

Choose a version

metal-runner-action

Experimental

GitHub Super-Linter

This Experimental GitHub Action sets up an Equinix Metal server that can be used to run code in your workflows.

💡 See also:

Inputs

Name Description Required Default
github_token GitHub token with repository scope Yes -
metal_auth_token API Key for Equinix Metal Yes -
metal_project_id Project ID for Equinix Metal Yes -
metro Metro for Equinix Metal Yes -
plan Plan for Equinix Metal Yes -
os OS for Equinix Metal No ubuntu_22_04
provisioning_timeout How long to wait for provisioning (min) No 30
repository_level Set to true to enable repository level registration token No false
custom_script Custom user script to run (as root) before starting the runner No ""

Usage

name: CI Pipeline

on:
  push:
    branches:
      - main

jobs:
  Project:
    name: "Create Project"
    runs-on: ubuntu-latest

    steps:
      - name: metal-project-action
        id: metal-project-action
        uses: equinix-labs/metal-project-action@v0.14.0
        with:
          projectName: "metal-runner-demo"
          userToken: ${{ secrets.METAL_AUTH_TOKEN }}

    outputs:
      projectID: ${{ steps.metal-project-action.outputs.projectID }}

  Runner:
    name: "Create Runner"
    needs: Project
    runs-on: ubuntu-latest

    steps:
      - name: metal-runner-action
        uses: equinix-labs/metal-action-runner@v0.1.1
        with:
          github_token: ${{ secrets.TEST_PAT_KEY }}
          metal_auth_token: ${{ secrets.METAL_AUTH_TOKEN }}
          metal_project_id: ${{ needs.Project.outputs.projectID }}
          metro: "da"
          plan: "c3.small.x86"
          os: "ubuntu_20_04"

  Demo:
    name: "Demo Action"
    needs: Runner
    runs-on: self-hosted

    steps:
      - run: |
          echo "Hello, Equinix Metal!"
          echo "This is runner: ${{ runner.name }}"
          echo "Running on ${{ runner.arch }} ${{ runner.os }}"

  Cleanup:
    name: "Cleanup"
    runs-on: ubuntu-latest
    needs: [Demo, Project]

    steps:
      - name: metal-sweeper-action
        uses: equinix-labs/metal-sweeper-action@v0.6.0
        with:
          authToken: ${{ secrets.METAL_AUTH_TOKEN }}
          projectID: ${{ needs.Project.outputs.projectID  }}
          keepProject: false

Support

This repository is Experimental meaning that it's based on untested ideas or techniques and not yet established or finalized or involves a radically new and innovative style! This means that support is best effort (at best!) and we strongly encourage you to NOT use this in production.