Actions/actions/cache
actions

Cache

actions/cache

View on GitHub

Cache dependencies and build outputs to improve workflow execution time

4,300stars
950forks
8.0M uses
Performancev3.3.2

About

This action allows caching dependencies and build outputs to improve workflow execution time. It can cache any files or directories you specify, making subsequent runs faster by restoring cached content.

Workflow Example

name: CI
on: [push, pull_request]

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/cache@v4
        with:
          fetch-depth: 0
      
      - name: Run tests
        run: npm test

Inputs

repository

Repository name with owner

Default: ${{ github.repository }}

ref

The branch, tag or SHA to checkout

token

Personal access token (PAT)

Default: ${{ github.token }}

fetch-depth

Number of commits to fetch

Default: 1

Metadata

Language

TypeScript

Last Updated

1/18/2024

Latest Release

v3.3.2