You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/workflows/cicd.yml
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -11,13 +11,13 @@ on:
11
11
pull_request:
12
12
13
13
env:
14
+
GITHUB_REPO: ${{ secrets.REPO }} # Should be a private repository, see https://help.github.com/en/actions/hosting-your-own-runners/adding-self-hosted-runners
15
+
TOKEN: ${{ secrets.TOKEN }} # Personal Access Token used to register and deregister runners. GITHUB_TOKEN isn't good for most use cases because it is only valid for one hour.
14
16
GCP_PROJECT: ${{ secrets.GCP_PROJECT }}
15
17
GKE_CLUSTER: self-hosted-runner-test-cluster
16
18
GKE_SECRETS: self-hosted-runner-creds
17
19
GCP_REGION: us-west1
18
20
IMAGE: self-hosted-runner
19
-
GITHUB_REPO: ${{ secrets.REPO }} # should be a private repository, see https://help.github.com/en/actions/hosting-your-own-runners/adding-self-hosted-runners
20
-
TOKEN: ${{ secrets.TOKEN }} # Personal Access Token used to register and deregister runners. GITHUB_TOKEN isn't good for most use cases because it is only valid for one hour.
Copy file name to clipboardExpand all lines: README.md
+4-21Lines changed: 4 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,26 +1,11 @@
1
1
# GitHub Actions Self Hosted Runners on Anthos
2
2
3
-
This project shows an _example_configuration and usage of GitHub Actions self hosted runners on Anthos, using the [self hosted runners API](https://developer.github.com/v3/actions/self_hosted_runners/). Under active development 🧪.
3
+
> An _example configuration and usage_ of GitHub Actions [self hosted runners](https://help.github.com/en/actions/hosting-your-own-runners/about-self-hosted-runners) on [Anthos GKE](https://cloud.google.com/anthos/gke). Under active development 🧪.
4
4
5
5
A Continuous Integration [job](https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobs) builds the image and publishes it to Google Container Registry, and a Continuous Deployment job deploys it to Google Kubernetes Engine (GKE). The self hosted runners in this cluster are made available to the GitHub repository configured via the `GITHUB_REPO` environment variable below.
6
6
7
-
## Usage
7
+
## Setup
8
8
9
-
### Local
10
-
11
-
#### Setup
12
-
13
-
Set these in an `.env` file at the top level. Inject these into the Docker container at runtime; do _not_ check them in to Git in plaintext.
14
-
*`GITHUB_REPO` - repository to allow to use the self hosted runner (eg. `octocat/spoon-knife`)
15
-
*`TOKEN`: [Personal Access Token](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line) or [OAuth app token](https://developer.github.com/apps/building-oauth-apps/authorizing-oauth-apps/) with `administration` permission, which is necessary for interacting with the [Self Hosted Runner API](https://developer.github.com/v3/actions/self_hosted_runners/). [`GITHUB_TOKEN`](https://help.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token) does not have `administration` permission.
16
-
17
-
#### Run Docker container
18
-
*`docker build -t self-hosted-runner .`
19
-
*`docker run --env-file=.env -v /var/run/docker.sock:/var/run/docker.sock self-hosted-runner` (Docker-in-Docker not recommended for production)
20
-
21
-
### Google Kubernetes Engine
22
-
23
-
#### Setup
24
9
* Create a new Google Cloud Platform project ([docs](https://cloud.google.com/sdk/gcloud/reference/projects/create))
*Which repository or organization will your self hosted runners be available to? Use [Kubernetes secrets](https://kubernetes.io/docs/concepts/configuration/secret/) to make these environment variables available to your pods.
59
+
* Use [Kubernetes secrets](https://kubernetes.io/docs/concepts/configuration/secret/) to provide a Personal Access Token (`TOKEN`) and repository/organization (`GITHUB_REPO`) as environment variables available to your pods.
0 commit comments