Continuous deployment

Edit this page

Learn how to use the fingerprint runtime version for continuous deployment in production and during development.


Prerequisites

  • You need to have a GitHub account and use it to host your git project.
  • You need to have an Expo token configured in your GitHub repository.
How to configure the EXPO_TOKEN environment variable on your GitHub repository

GitHub Action: continuous-deploy-fingerprint

This is available in beta for SDK 51 and not yet considered stable. Use may result in unexpected system behavior.

Expo provides a GitHub Action called continuous-deploy-fingerprint to provide CI/CD for a React Native project. It dictates that every JS change (update) is deployed to all compatible builds over-the-air, and new builds are created when the runtime changes.

It is typically accomplished by performing roughly these steps:

  1. Run application tests, abort if tests fail (continuous-deploy-fingerprint does not currently run tests, you can do configure your workflow to run tests first).
  2. Calculate fingerprint for relevant platforms using the npx expo-updates fingerprint:generate command.
  3. Check for EAS builds with a runtime version equal to the fingerprint (eas build:list --runtimeVersion <fingerprint>). Create a new build if none exists yet.
    • (optional) Submit to app stores for full continuous deployment. This has not yet been tested and is not recommended.
  4. Run eas update to publish an update for the current commit.

Fingerprint runtime versioning

The fingerprint runtime version policy uses the @expo/fingerprint package to generate a hash of your project when making a build or publishing an update, and then uses that hash as the runtime version. The hash is calculated based on dependencies, custom native code, native project files, and configuration, amongst other things.

By automatically calculating the runtime version, you don't have to be concerned about native layer compatibility with the JavaScript application when deploying updates to builds.

How do I debug fingerprint inconsistencies between my local machine and CI/CD?

If you notice different fingerprints being generated across different machines or environments, it may mean that unanticipated files are being included in the hash calculation. @expo/fingerprint has a predetermined set of files to include/exclude for hash calculation, but often your project setup may require additional excludes. For projects that include native directories (android and ios) this is more common.

We provide tools for identifying which files are causing fingerprint inconsistencies and mechanisms to exclude those files from fingerprint calculations for your project.

To identify differences in fingerprints on different machines or environments:

  • When running fingerprint generation commands on each machine/environment (npx expo-updates fingerprint:generate), pass --debug flag.
  • Diff outputs from those command runs to determine files causing the difference. These tools may be helpful:

To exclude files causing the differences, add them to the .fingerprintignore file as described in the @expo/fingerprint README.

How do I debug the commands that are run in the workflow?

Running your GitHub workflows in debug mode will automatically add the --debug flag to the commands run as part of the action, and the output will be available in the workflow run logs.

GitHub Action: expo-github-action

An alternative GitHub action is expo-github-action that can be used to publish updates on push and previews on pull requests. continuous-deploy-fingerprint uses fingerprints to determine if a build is needed or not to deploy an update, while expo-github-action will only publish updates.

  • To learn about publishing updates when code is pushed to the main branch, refer to the README.
  • To learn about Pull Request previews with expo-github-action, refer to the GitHub PR Previews guide.