container:
  # ... other container options
  valid_volumes:
    - '/mnt/runner-cache/**'
  options: '--volume /mnt/runner-cache:/toolcache' # Mount the host path to the job container's cache directory


Method 1: Using the act_runner configuration file (config.yaml)
You can define common volumes that should be mounted into all job containers in the runner's configuration file. 

    Identify your host path: Determine the absolute path on the host machine where the PVC is mounted. In Kubernetes/Docker environments, this might be a specific path managed by your storage provider, or a directory you manually bound a volume to. Let's assume it is /mnt/runner-cache.
    Edit config.yaml: Add the valid_volumes configuration under the container section of your config.yaml file to explicitly allow mounting that specific path. You can also specify common mounts for all jobs.
    yaml

    container:
      # ... other container options
      valid_volumes:
        - '/mnt/runner-cache/**'
      options: '--volume /mnt/runner-cache:/toolcache' # Mount the host path to the job container's cache directory

    Use code with caution.

    The options line uses standard Docker command-line syntax to add a volume mount: -v <host_path>:<container_path>.
    /toolcache is the hardcoded default directory within the job container where the actions/cache and setup-* actions store their data.

Restart the runner: For the changes to take effect, you must restart your act_runner container or service. 

Method 2: Using the Workflow File (less ideal for central management)
If you prefer per-workflow control, you can define the volume mount directly in the Gitea Actions workflow YAML file. This requires you to ensure the runner has permission to mount this path (which the docker.sock mapping usually implies).
yaml

jobs:
  build:
    runs-on: ubuntu-latest
    container:
      image: your_job_image
      volumes:
        # Mount the host PVC path to the container cache path
        - /mnt/runner-cache:/toolcache
    steps:
      # ... your steps using actions/cache

Use code with caution.
Ensure the Cache is Used in the Workflow 
