icon

Bitrise.io Cache:Push

Updates the Cache, if required

⚠️   The branch-based caching steps are deprecated and being replaced by key-based caching. Check out our migration guide: [Migrating from branch-based caching to key-based caching](https://devcenter.bitrise.io/en/dependencies-and-caching/branch-based-caching/migrating-from-branch-based-caching-to-key-based-caching.html).

Checks whether cache has to be updated based on the Cache Paths and Ignore Paths inputs. If it does, the Step creates a new cache archive and uploads it. It won't update/upload the cache if the cache hasn't changed nor in the case of a pull request unless you change the Step's run_if property. For caching, you will need the Bitrise.io Cache:Pull Step at the beginning of your Workflow (after the Git Clone Repository Step but before a dependency installer Step) to download the previous cache, if any. The Bitrise.io Cache:Push Step should be the very last Step in your Workflow.

Configuring the Step

  1. Cache any directory or file by adding it in the Cache paths field. For most cases, caching will automatically work based on your native build and testing Steps as these automatically configure cache paths in your cache Steps. If adding multiple paths, separate them with a newline. If you have a path in the list which does not exist, it will not cause the Step to fail. You can also specify an update indicator file with the -> syntax, for example, update/this -> if/this/file/is/updated. Please note the indicator points to a file and not to a folder.
  2. In the Ignore Paths from change check field, you can set any path which you don't want to do change analysis for.
  • Paths prefixed with an ! will get ignored from the cache archive.
  • The path can also include *, **, /. The * will replace a path element, the ** will replace part of a path. To exclude a full directory, simply put a / behind the directory. Note that you can't ignore a path which results in an invalid cache item.
  1. Modify Working directory if you wish to set relative cache paths and reference them from a working directory other than $BITRISE_SOURCE_DIR.
  2. Select a Fingerprint Method option (file-content-hash or file-mod-time) to detect changes in a directory, file, or in an update indicator file. If changes are detected, new cache gets generated.
  3. If you set Debug mode? input to true, the Step will print out more detailed logs.
  4. With Compress cache? input set to true, you can compress the cache archive for faster uploads and downloads, especially useful for node-modules and other huge dependency folders.
  5. In Ignore paths collected by steps you can set which files or extensions should be ignored by the Step during the build.
  6. Cache Upload URL shows the URL where the cache gets uploaded.

Troubleshooting

We recommend you do not cache any dependency manager lock file (for example, package.lock, gemfile.lock, podfile.lock) as it would override the lock file in your repository.

Useful links

Related Steps

Similar steps

Deploys build artifacts to make them available for the user on the build's Artifacts tab. Sends test results to the Test Reports (build's Tests tab). Uploads Pipeline intermediate files to make them available in subsequent Workflows and also uploads Bitrise and user generated html reports.

Activates Bitrise Remote Build Cache for subsequent Bazel builds in the workflows.

Activates Bitrise Remote Build Cache add-on for subsequent Gradle builds in the workflow

Activates Bitrise Build Cache features for React Native projects