From 630cd3a22c244aa908378cda7d06c19825231742 Mon Sep 17 00:00:00 2001 From: sebthom Date: Fri, 28 Jul 2023 18:49:40 +0200 Subject: [PATCH] add ACT_CACHE_SERVER_EXTERNAL_URL environment variable --- README.md | 4 ++-- image/config.template.yaml | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 577f471..7e97ef2 100644 --- a/README.md +++ b/README.md @@ -155,12 +155,12 @@ GITEA_RUNNER_ACTION_CACHE_DIR|`/data/cache/actions`|Path to cache cloned actions #### Embedded cache server: Name|Default Value|Description ----|-------------|----------- -ACT_CACHE_SERVER_ENABLED|`true`| Enable the embedded cache service to use `actions/cache` in jobs +ACT_CACHE_SERVER_ENABLED|`true`| Enable the use of an embedded or external cache server with `actions/cache` in jobs +ACT_CACHE_SERVER_EXTERNAL_URL|``|URL to an external cache server. If specified, act_runner will use this URL as the ACTIONS_CACHE_URL instead of starting an embedded server. The URL should end with "/". ACT_CACHE_SERVER_DIR|`/data/cache/server`| The directory to store the cache data ACT_CACHE_SERVER_HOST|``| The IP address or hostname via which the job containers can reach the cache server. Leave empty for automatic detection ACT_CACHE_SERVER_PORT|`0`|The TCP port of the cache server. `0` means to use a random, available port - ## License All files in this repository are released under the [Apache License 2.0](LICENSE.txt). diff --git a/image/config.template.yaml b/image/config.template.yaml index 3241fe7..39a3ed1 100644 --- a/image/config.template.yaml +++ b/image/config.template.yaml @@ -1,4 +1,4 @@ -# based on https://gitea.com/gitea/act_runner/src/tag/v0.2.3/internal/pkg/config/config.example.yaml +# based on https://gitea.com/gitea/act_runner/src/tag/v0.2.4/internal/pkg/config/config.example.yaml log: # The level of logging, can be trace, debug, info, warn, error, fatal @@ -52,6 +52,10 @@ cache: # The port of the cache server. # 0 means to use a random available port. port: ${ACT_CACHE_SERVER_PORT:-0} + # The external cache server URL. Valid only when enable is true. + # If it's specified, act_runner will use this URL as the ACTIONS_CACHE_URL rather than start a server by itself. + # The URL should generally end with "/". + external_server: ${ACT_CACHE_SERVER_EXTERNAL_URL:-} container: # Specifies the network to which the container will connect.