> ## Documentation Index
> Fetch the complete documentation index at: https://docs.blacksmith.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# Actions

> Blacksmith automatically caches your dependencies to speed up your workflows

## Overview

When you run jobs on Blacksmith, all official GitHub and popular third-party cache actions
transparently interact with our 4x faster, colocated cache, instead of GitHub's backend.

**Zero code changes are required.**

<CodeGroup>
  ```yml actions-cache@v5 icon="code" lines theme={"system"}
      # If it's running on Blacksmith, it will use our cache
      name: Cache Cargo dependencies
      uses: actions/cache@v5
  ```

  ```yml actions-cache-save@v5 icon="code" lines theme={"system"}
      # If it's running on Blacksmith, it will use our cache
      name: Save cache
      uses: actions/cache/save@v5
      with:
        path: node_modules
        key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
  ```

  ```yml actions-cache-restore@v5 icon="code" lines theme={"system"}
      # If it's running on Blacksmith, it will use our cache
      name: Restore cache
      uses: actions/cache/restore@v5
      with:
        path: node_modules
        key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
  ```

  ```yml setup-go@v6 icon="code" lines theme={"system"}
      # If it's running on Blacksmith, it will use our cache
      name: Setup go
      uses: actions/setup-go@v6
      with:
        go-version: '>=1.17.0'
  ```

  ```yml setup-node@v6 icon="code" lines theme={"system"}
      # If it's running on Blacksmith, it will use our cache
      name: Setup node
      uses: actions/setup-node@v6
      with:
        node-version: 20
        cache: 'npm'
  ```

  ```yml setup-python@v6 icon="code" lines theme={"system"}
      # If it's running on Blacksmith, it will use our cache
      name: Setup python
      uses: actions/setup-python@v6
      with:
        python-version: '3.9'
        cache: 'pip'
  ```

  ```yml setup-ruby@v1 icon="code" lines theme={"system"}
      # If it's running on Blacksmith, it will use our cache
      name: Setup ruby
      uses: ruby/setup-ruby@v1
      with:
        ruby-version: '3.3'
        bundler-cache: true
  ```

  ```yml setup-java@v5 icon="code" lines theme={"system"}
      # If it's running on Blacksmith, it will use our cache
      name: Setup java
      uses: actions/setup-java@v5
      with:
        distribution: 'temurin'
        java-version: '21'
  ```
</CodeGroup>

<Warning>Currently, the Rust `sccache` and the GitHub Actions cache option in the `docker/build-push-action` are still redirected to GitHub's backend. For 40x faster Docker builds, please use our Blacksmith Docker actions. For more information, refer to the [Docker builds](/blacksmith-caching/docker-builds) page.</Warning>

## Basics

GitHub’s cache action stores artifacts in Azure Blob Storage. When your runner isn’t in the same availability zone,
downloads are often slow and unreliable.

Blacksmith fixes this by storing cache artifacts in the same datacenter as your runners. Our approach removes network
latency and almost saturates the NIC. As a result, your downloads complete around 4x faster, with no code changes required.

### Branch Protected Caches

When using our colocated cache, each cache entry will be scoped to its branch or tag to
ensure cache entries are only accessible to the appropriate workflow runs. This enhances the
security of our cache offering by creating a logical boundary between cache artifacts. These access
restrictions are consistent with [GitHub's
implementation](https://docs.github.com/en/actions/reference/dependency-caching-reference#restrictions-for-accessing-a-cache).
If you would rather share cache artifacts across branches in a repository, you can toggle this
feature `off` in the settings page of your Blacksmith dashboard.

### Opt out

If you’d rather not use our cache for any reason, just let us know by opening a [support ticket](https://app.blacksmith.sh/?support=open) and we’ll disable it for you.

## Pricing

There is no additional cost for using our cache. For all other pricing, please visit our [pricing page](https://www.blacksmith.sh/pricing).

## FAQ

<AccordionGroup>
  <Accordion title="How much free storage do I get?">
    By default, we provide 25GB of free storage per repo per week, a substantial increase from GitHub's 10GB to maximize your cache hits.
  </Accordion>

  <Accordion title="How can I increase the allowed cache size for my organization?">
    If you'd like us to increase the allowed cache size for your organization, contact us at
    [support@blacksmith.sh](mailto:support@blacksmith.sh).
  </Accordion>

  <Accordion title="What is the eviction policy?">
    Like GitHub, our cache evicts the least recently used cache entries that were last accessed more than 7 days ago.
  </Accordion>

  <Accordion title="Didn't you support another actions cache?">
    Our `useblacksmith/cache` action and all language-specific cache actions (e.g. `useblacksmith/setup-go`, `useblacksmith/setup-node`, `useblacksmith/setup-python`, `useblacksmith/setup-ruby`, `useblacksmith/setup-java`, `useblacksmith/rust-cache`, etc.) are archived and will no longer be maintained by Blacksmith.

    Our [new cache](/blacksmith-caching/dependencies-actions) requires no code changes and works automatically with GitHub's native cache actions. We recommend migrating any workflows still referencing `useblacksmith/*` cache forks to the upstream versions of those actions.
  </Accordion>
</AccordionGroup>
