Example demonstrating how to create a custom build cache provider for Expo CLI. Uses GitHub to store builds.
-
Create a GitHub Personal Access Token with repo permissions:
- Go to GitHub Settings › Developer settings › Personal access tokens.
- Click Generate new token, select the repo scope, and copy the token.
- Set it in your shell:
export GITHUB_TOKEN=YOUR_TOKEN_HERE
-
Configure your Expo project:
- Open
app.json
. - Update the
remoteBuildCache
block under theexpo
key:{ "expo": { "remoteBuildCache": { "provider": "./buildCacheProviderPlugin.js", "options": { "owner": "<YOUR_GITHUB_USERNAME>", "repo": "<YOUR_REPO_NAME>" } } } }
- Replace
<YOUR_GITHUB_USERNAME>
and<YOUR_REPO_NAME>
with your details.
- Open
-
Run
yarn
ornpm install
-
Run
yarn start
ornpm run start
to try it out.
Tip: If you’d rather not create prereleases in your main repository, point
repo
to a separate GitHub project or private repo and update therepo
option inremoteBuildCache
.