How to Cache Artifacts in CI

May 30, 2026 | 5 min read

GitHub Actions Cache

- uses: actions/cache@v4
  with:
    path: ~/.pyvorin/cache
    key: pyvorin-${{ runner.os }}-${{ hashFiles('**/*.py') }}

GitLab CI Cache

cache:
  paths:
    - ~/.pyvorin/cache

Key Strategy

Use the hash of your Python files as part of the cache key to invalidate when source changes.