mirror of
https://codeberg.org/forgejo/docs.git
synced 2025-03-13 09:58:07 -04:00
docs: explain caching for Actions
This commit is contained in:
parent
35ab54e048
commit
e4bc43437b
2 changed files with 27 additions and 0 deletions
|
@ -209,6 +209,22 @@ host:
|
||||||
workdir_parent:
|
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
|
## 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:
|
Once the `Forgejo runner` is successfully registered, it can be run from the directory in which the `.runner` file is found with:
|
||||||
|
|
|
@ -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.
|
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
|
## 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)):
|
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)):
|
||||||
|
|
Loading…
Add table
Reference in a new issue