diff --git a/README.md b/README.md index e1f9d58..48b734f 100644 --- a/README.md +++ b/README.md @@ -25,5 +25,17 @@ The runner can be deployed in Docker using either `docker run` or `docker compos #### Deployment in `docker` ``` -docker run -d -e ORGANIZATION="" -e ACCESS_TOKEN="" -e REPO="" emberstack/github-actions-runner +docker run -d -e ACCESS_TOKEN="" -e ORGANIZATION="" -e REPO="" emberstack/github-actions-runner ``` + +> See [Managing your personal access tokens](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens) to understand how to get an access token. + +You can customize the values of the deployment by using the following environment variables: + +| Environment Variable | Description | Required | +|-------------------------------|---------------------------------------------------------------------------------------------------|----------------------------------------------------------| +| `ACCESS_TOKEN` | The access token (PAT - Personal Access token) used to register the runner | Required | +| `ORGANIZATION` | The owner or organization | Required | +| `REPO` | The repository on which to register the runner | Optional - Registers to the org. if not specified | +| `LABELS` | Comma separated list of labels to apply to the runner | Optional | +| `NAME` | Runner name | Optional - Defaults to the hostname if not specified | \ No newline at end of file diff --git a/src/docker/Dockerfile b/src/docker/Dockerfile index 96a4b56..9cc56c9 100644 --- a/src/docker/Dockerfile +++ b/src/docker/Dockerfile @@ -16,11 +16,6 @@ RUN apt-get update \ unzip \ && rm -rf /var/lib/apt/lists/* - -# RUN apt install -y --no-install-recommends \ -# curl jq build-essential libssl-dev libffi-dev python3 python3-venv python3-dev python3-pip - - WORKDIR /actions-runner COPY ./start.sh . diff --git a/src/docker/start.sh b/src/docker/start.sh index b1129a3..144db31 100644 --- a/src/docker/start.sh +++ b/src/docker/start.sh @@ -17,6 +17,8 @@ fi ORGANIZATION=$ORGANIZATION ACCESS_TOKEN=$ACCESS_TOKEN REPO=$REPO +LABELS=$LABELS +NAME=$NAME echo "Setup - Determining matching runner..." @@ -42,9 +44,9 @@ fi echo "Setup - Configuring runner..." if [ -z "$REPO" ]; then - ./config.sh --url https://github.com/${ORGANIZATION} --token ${REG_TOKEN} + ./config.sh --url https://github.com/${ORGANIZATION} --token ${REG_TOKEN} --labels ${LABELS} --name ${NAME} else - ./config.sh --url https://github.com/${ORGANIZATION}/${REPO} --token ${REG_TOKEN} + ./config.sh --url https://github.com/${ORGANIZATION}/${REPO} --token ${REG_TOKEN} --labels ${LABELS} --name ${NAME} fi cleanup() {