Using Github Actions and the Anka Build Cloud

Instructions on how to use Github Actions with the Anka Build Cloud

If you want to hide the VM up/down steps from your workflow YAML, use Anklet. Anklet is an external orchestrator that starts on-demand, ephemeral Anka macOS VMs for GitHub Actions without those steps in the workflow.

The Anka Actions monorepo provides GitHub Actions for orchestrating ephemeral, self-hosted runners on Anka Build Cloud. Each action lives in its own subfolder and is referenced by path. You can also find them on the GitHub Marketplace.

ActionPathDescription
Anka Actions - Upveertuinc/anka-actions/[email protected]Spins up a new Anka VM instance and registers a self-hosted runner.
Anka Actions - Downveertuinc/anka-actions/[email protected]Tears down the Anka VM instance and removes the runner.

VM Template & Tag Requirements

  1. Install the GitHub runner inside of your VM. We recommend using our installation script.

  2. Create a GitHub personal access token and add it as a repository secret. The token owner must be a repository Admin — permissions on the token cannot exceed the account’s role.

    • Classic PAT: repo scope
    • Fine-grained PAT: resource owner = org/user that owns the repo; Administration: Read and write on the target repo

Usage

Reference each action by its folder path within the anka-actions repository:

jobs:
  action-up:
    runs-on: ubuntu-latest
    steps:
      - uses: veertuinc/anka-actions/[email protected]
        id: action-up
        with:
          gh-pat: ${{ secrets.SERVICE_USER_PAT }}
          template-id: '9690461a-02b5-412d-8778-dab4167743db'
          controller-url: 'https://controller.mysite.com'
    outputs:
      action-id: ${{ steps.action-up.outputs.action-id }}

  inside_vm_job:
    needs: action-up
    runs-on: [ self-hosted, "${{ needs.action-up.outputs.action-id }}" ]
    steps:
      - name: Inside VM Job
        run: echo "running on runner inside of VM (${{ needs.action-up.outputs.action-id }})"

  action_down:
    if: always()
    needs: [ action-up, inside_vm_job ]
    runs-on: ubuntu-latest
    steps:
      - uses: veertuinc/anka-actions/[email protected]
        with:
          action-id: ${{ needs.action-up.outputs.action-id }}
          gh-pat: ${{ secrets.SERVICE_USER_PAT }}
          controller-url: 'https://controller.mysite.com'

See the repository READMEs for the full list of inputs, outputs, and advanced configuration (certificate auth, root token auth, GitHub Enterprise Server, etc.):


Release Notes

Release notes for the Anka GitHub Actions can be found on the anka-actions releases page.