From fdc76d629bf32cf4e1d9b7d1b55ff092124c0e43 Mon Sep 17 00:00:00 2001 From: mullayanov Date: Sat, 19 Apr 2025 22:56:20 +0500 Subject: [PATCH] one more re-registration fix --- .gitignore | 2 ++ README.md | 24 ++++++++++++++++++++++++ entrypoint.ps1 | 2 +- 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 7780464..6375e04 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ *.bak +*.bat +.runner docker-compose.yml \ No newline at end of file diff --git a/README.md b/README.md index 62986b2..ebe22aa 100644 --- a/README.md +++ b/README.md @@ -14,3 +14,27 @@ The build images can be found on [Docker Hub](https://hub.docker.com/r/fidarit/g | `GITEA_RUNNER_REGISTRATION_TOKEN` | The format of the registration token is a random string D0gvfu2iHfUjNqCYVljVyRV14fISpJxxxxxxxxxx. | | `GITEA_RUNNER_LABELS` | A comma separated string to indicate the labels. Default is 'windows:host' | | `GITEA_INSTANCE_URL` | URL of the Gitea server e.g gitea.mycompany.com. | + + +## docker-compose.yml example + +```yml +volumes: + runner_cache: {} + runner_packages_cache: {} + +services: + runner: + build: + context: . + dockerfile: Dockerfile + environment: + GITEA_INSTANCE_URL: "http://myhost.mycompany.com:8080" + GITEA_RUNNER_REGISTRATION_TOKEN: "abcdefghijklmnopqrstuvwxyz0123456789ABCD" + GITEA_RUNNER_NAME: "windows-docker" + GITEA_RUNNER_LABELS: "windows:host,windows-latest:host" + volumes: + - .\data:c:\actions-runner\data + - runner_cache:c:\users\ContainerAdministrator\.cache + - runner_packages_cache:c:\users\ContainerAdministrator\.nuget\packages +``` \ No newline at end of file diff --git a/entrypoint.ps1 b/entrypoint.ps1 index f0448b8..157ca09 100644 --- a/entrypoint.ps1 +++ b/entrypoint.ps1 @@ -13,7 +13,7 @@ try { Push-Location "data" # Check if runner is already registered - if (-not (Test-Path -Path "data/.runner")) { + if (-not (Test-Path -Path ".runner")) { Write-Host "Configuring new runner: $GITEA_RUNNER_NAME" ../act_runner.exe register --no-interactive --instance $GITEA_INSTANCE_URL --token $GITEA_RUNNER_REGISTRATION_TOKEN --name $GITEA_RUNNER_NAME --labels $LABELS }