Here's a (hopefully complete) step-by-step guide to getting this repository and setting this up in a new GHES instance.
-
Clone this repository to a machine with Docker installed. We'll need to do the very first set of runners manually, so that GitHub has runners to build its' runners on. We'll come back to this in a bit.
-
Mirror this repository to your GHES server. Directions
-
Now let's set up some credentials. You'll need the following:
- An enterprise admin account with a PAT using the
enterprise:admin
scope. This is used by the runner controller to control the runners joined to GHES in the setup docs here - A non-admin account that can read from the repo (or org) where you're going to publish the Docker images to GitHub Packages. This account needs a PAT with the
read:packages
scope and is used by the runner controller as the image pull secret. In the setup docs, I called this secretghe
. - The setup docs have you create two namespaces,
runners
andtest-runners
. There are two service account YAML files, one for each namespace, for GHES to use to deploy itself. Please apply them usingkubectl apply -f serviceaccount.yml
and copy thekubeconfig
file for each. You will need to save it to a text file, then usecat filename.txt | base64
to base64 encode it. This big string of gibberish will become the two GitHub Secrets used by the deployment workflows. - A non-admin account that owns the repo (or org) where you're going to publish the Docker images to GitHub Packages. This account needs a PAT with the
delete:packages
andwrite:packages
scopes. It's used in GitHub Secrets asGHE_TOKEN
to publish the packages and the username is saved asGHE_USERNAME
.
- An enterprise admin account with a PAT using the
-
Move the
github/workflows
directory to.github/workflows
in the new repository. I don't want to clutter up this repo in .com with things that will fail because it's assuming non-standard runners. -
Now let's build and push the first set of runners. From the machine you cloned this to on step #1, let's run the following to build and push that first set.
cd images/ docker login docker.your-ghe-url docker build -f image-name.Dockerfile -t tag-goes-here . docker push tag-goes-here
-
Next, let's set up the runner controller as outlined here and use the deployments to create the first set of runners. You will need to edit them to include your GHE server's hostname, your enterprise name, etc. Wait a few minutes for the deployment to complete.
-
Log in to your GHE server and navigate to
HOSTNAME/enterprises/ENTERPRISE-NAME/settings/actions/self-hosted-runners
. You should now see something like this: -
From here, the workflows should be able to build, test, and push themselves via the workflows defined for GitHub Actions. Here's what that looks like in practice: