2
votes

We need to use the Github action self-hosted runner because we need to have an access to the on-premises resource.

I understand that we can run the self-hosted runner on VM or the docker container.

Can we run the self-hosted runner on-demand? Like the Github-hosted runner that always use the clean isolated VM and is destroyed at the end of job execution. Or like the job agents on Azure DevOps/Github that created the clean job agent container to run the pipeline and gets deleted at the end.

Can we do something similar with Gihub-action self-hosted runner? E.g. Allow us to register a VM with the Docker engine or Kubernetes cluster as a self-hosted runner. When I run the Github workflow, it should start a container and run the workflow inside that container. After that, it should delete the container.

Is it possible to do that now? I am not sure if there is a roadmap document somewhere for Github action.

2
Checkout github.com/evryfs/github-actions-runner-operator - it provisions runners based on demand. - David Karlsen

2 Answers

2
votes

If you use AWS, you can try ec2-github-runner. It does exactly what you're looking for.

I believe the same approach can also be implemented for the other cloud providers.

GitHub itself doesn't provide such capabilities at the moment.

0
votes

I think the question is a little bit misleading but, if I understand properly, what you are trying to achieve is to have stateless GitHub Actions workflow run execution in your self-hosted runner. Unfortunately, this is currently impossible. Only GitHub-hosted runners work the way you describe. According to the documentation:

GitHub-hosted runner is always a clean isolated virtual machine, and it is destroyed at the end of the job execution.

You can read more about the differences between each runner type here.