Back to Blog

Automatic Deployment of React Native iOS Apps with Fastlane and Github Actions

Prameet Chakraborty
Image for post

As developers, we have all faced the urge to automate our deployments in order to save precious development time. This urge escalates to its crescendo especially when dealing with mobile app deployments due to the complex and lengthy processes involved.

Any iOS Developer would relate to time wasted sitting in front of their machines waiting for the signed build to archive and the whole nightmare of uploading to testflight or the App store! The story with Android platforms is no different.

Thankfully, these days we have great tools and choices that are so remarkable that they not only make our development life easier but also carves out more time for things that really need our focus, clearly deployment is not one of them!. One of these great tools is fastlane.

Their official website is


In this article we will look at setting up automatic deployments of React Native iOS Apps with Fastlane on a CI Tool called Github Actions or similar

While I was working on it, I couldn’t find a comprehensive article that explained all of the processes in tandem, so I decided to write one myself to help developers in the community who are looking for better ways to automate their build process.


Before we begin, there are some prerequisites that need to be installed locally.

  1. Fastlane CLI
  2. XCode

In your project root directory create a folder called fastlane, inside which you will need to create the following files

Image for post
Image for post
  • The Fastfile is the brain of the whole process; We shall discuss it in detail in the below sections.
  • The Appfile contains app specific information
  • The Pluginfile contains plugin dependencies (autogenerated when you install dependencies)
  • The testers.txt contains all testers’ emails separated by commas, eg:,

Let’s get to business then…

First, let me summarise all the steps that will lead to a successful deployment

  1. Increment Build Number / Version Number
  2. Override some build settings to align with Fastlane
  3. Create a keychain to store values (only required when using CI)
  4. Obtain Certificates and Provisioning profiles to sign the app
  5. Update code signing settings
  6. Build and archive the app
  7. Upload and distribute to testers

Yes that’s it! These are all the steps that we will go through to get the app deployed!

Now let’s get to each step in detail!

Increment Build Number / Version Number

The first step involves updating the build / version number so that it does not conflict with your earlier build.


Updating version number is optional. However please note that build numbers have to be updated every time you create a new build to maintain uniqueness

To achieve this, we use fastlane’s increment_build_number and increment_version_number methods and pass the path to our Xcode Project.

The bump type of patch indicates that we are doing a minor version change.

Override some build settings to align with Fastlane

Next, we shall make some small manual overrides to make sure that we are using the right settings before building

Here we are explicitly setting our Bundle Identifier, Provisioning Profile and Development Team.

Create a keychain to store values (only required when using CI)

This step is only required if you are running Fastlane on a CI Tool like Jenkins, Github Actions, Bitrise etc. Locally it would use your system keychain


Create a new Keychain

We need to specify a name and password for our keychain, make sure you note down your CI Keychain password safely.

Obtain Certificates and Provisioning profiles to sign the app

For this step we will be using the match service of fastlane that can dynamically pick up certificates and profiles directly from a Github repo.


Before setting up match we need to first store our certificates safely in a private repository.

  • Create a Private Github Repository
  • Then run fastlane match development locally and follow all the steps, other methods are appstore , ad-hoc and enterprise
  • The earlier step would automatically set up all certificates, profiles and push to the remote repository.
  • When asked for the repo url, it needs to be specified in this format (IMPORTANT!)


NOTE: Setting readonly: true ensures that certificates are not generated again when match is run

Update code signing settings

Next step is to modify the code signing setting and force the usage of manual signing.


Build and archive the app

For this step, we will be using thegym service of Fastlane


Upload and distribute to testers

This is the final step. After archiving and signing the build we shall upload it and release to testers directly.

We are using Testflight to distribute our builds. Firebase App Distribution is another great alternative!


The final Fastfile would look like this…

To run this, just go to your root directory and run fastlane ios beta , this is because we are calling our lane as beta in line 97. Feel free to give any name to your lane!

Set up Fastlane on CI

Now, a final additional step is to setup this fastlane process on the CI. In our case we have used Github Actions!

We are configuring the build to run on every push action to the repo.

The above code snippet shall do the following

  1. Set Node Version to 12.17.0
  2. Run yarn install and install required dependencies
  3. Run pod install to install Cocoapods dependencies
  4. Run Fastlane to create the signed IPA Build
  5. Upload the IPA File as an artifact on Github

The environment variables for reference are


The unique identifier your app


Your Apple ID / Email


Your Apple Developer Account Password


Password entered while creating Github Repo with Match


Name of your keychain


Password of your keychain


URL of Github Repository containing your certificates


Apple Developer Team ID

If you want to run the whole process locally from terminal, setup a .env file in your fastlane folder add these variables

VOILA! Our automatic deployments are now set up. At the end fastlane also tells you how many minutes you saved. Sweet!

Image for post

Fastlane just saved me an hour of my time! Just imagine how many hours developers can save in their lifetime!

Image for post

More from the Blog

Native Lazy Loading 💤 is coming to our browser

The prospect of lazy-loading is to minimize the load of bundles that are loaded in the initial page fetch. With lazy-loading, these tags’ contents are not loaded until they are scrolled up to the viewport of the browser. This is famously used in Medium.

Read Story

Native FileSystem API is coming to our browser 😍

Accessing the filesystem is a common feature of apps, but coming to the browser it’s an all-out battle with the filesystem. But Chrome is changing all that with the coming of the Native Filesystem API. 

Read Story

Become a JavaScript-on-Mobile Pro with PWA’s

Responsive design took over the internet back in 2012, however the tech had been brewing since 2007, when Steve Jobs introduced the idea of web-apps to the world at the launch of the first iPhone.

Read Story

Stay in the Loop.

Gitstart runs a monthly email newsletter for developers, engineering leaders and CEOs, covering latest tips and trends.
We will never share your email address with third parties.