diff --git a/admin/actions.md b/admin/actions.md index 136f96e6..8394dc34 100644 --- a/admin/actions.md +++ b/admin/actions.md @@ -209,6 +209,22 @@ host: workdir_parent: ``` +## Cache configuration + +Some actions such as https://code.forgejo.org/actions/cache or +https://code.forgejo.org/actions/setup-go can communicate with the +`Forgejo runner` to save and restore commonly used files such as +compilation dependencies. They are stored as compressed tar archives, +fetched when a job starts and saved when it completes. + +If the machine has a fast disk, uploading the cache when the job +starts may significantly reduce the bandwidth required to download +and rebuild dependencies. + +If the machine on which the `Forgejo runner` is running has a slow +disk and plenty of CPU and bandwidth, it may be better to not activate +the cache as it can slow down the execution time. + ## Running the daemon Once the `Forgejo runner` is successfully registered, it can be run from the directory in which the `.runner` file is found with: diff --git a/user/actions.md b/user/actions.md index 0c8e49d0..db840545 100644 --- a/user/actions.md +++ b/user/actions.md @@ -42,6 +42,17 @@ One of the most commonly used action is [checkout](https://code.forgejo.org/acti Just as any other program of function, an `Action` has pre-requisites to successfully be installed and run. When looking at re-using an existing `Action`, this is an important consideration. For instance [setup-go](https://code.forgejo.org/actions/setup-go) depends on NodeJS during installation. +## Caching commonly used files + +When a `job` starts, it can communicate with the `Forgejo runner` to +fetch commonly used files that were saved by previous runs. For +instance the https://code.forgejo.org/actions/setup-go action will do +that by default to save downloading and compiling packages found in +`go.mod`. + +It is also possible to explicitly control what is cached and when +using the https://code.forgejo.org/actions/cache action. + ## Services PostgreSQL, redis and other services can conveniently be run from container images with something similar to (see the [full example](https://code.forgejo.org/actions/setup-forgejo/src/branch/main/testdata/example-service/.forgejo/workflows/test.yml)):