Note: GitHub Actions is currently in beta for GitHub AE.
Creating an AE hosted runner with a custom image
AE hosted runners can use operating system images that you've customized to suit your needs. This article includes the high level steps for creating the image in Azure and preparing it for GitHub AE. For more information, refer to the Azure documentation.
During this beta, to be able to create a custom image for AE hosted runners, you will need an Azure subscription that is able to provision a virtual machine.
-
Provision a new VM in your tenant using a marketplace image or a virtual hard drive(VHD).
-
Optionally, install your required software on the VM.
-
Deprovision the VM:
- For Linux:
ssh
to the VM and run:$ sudo waagent -deprovision+user
- For Windows: Follow the steps described at "Generalize the source VM by using Sysprep."
- For Linux:
-
Use the Azure CLI to deallocate and generalize the VM:
$resourceGroupName = "octocat-testgroup" $vmName = "octo-vm" Stop-AzVM -ResourceGroupName $resourceGroupName -Name $vmName Set-AzVM -ResourceGroupName $resourceGroupName -Name $vmName -Generalized
- Replace
octo-vm
with the name of your virtual machine. - For more information regarding these steps, see "How to create a managed image of a virtual machine or VHD."
- Replace
-
Generate a SAS URI for the VM's operating system disk.
-
Using the Azure Portal: On the disk resource, navigate to Disk Export, set
URL expires in (seconds)
to86400
(24 hours), and generate the URL. -
Using the Azure CLI:
$resourceGroupName = "octocat-testgroup" $vmName = "octo-vm" $vm = Get-AzVM -ResourceGroupName $resourceGroupName -Name $vmName Grant-AzDiskAccess ` -ResourceGroupName $resourceGroupName ` -DiskName $vm.StorageProfile.OsDisk.Name ` -Access Read ` -DurationInSecond 86400
- Replace
octo-vm
with the name of your virtual machine.
- Replace
-
Once you've created the image, you can have it added to GitHub AE. For more information, see "Adding an AE hosted runner with a custom image".