[SURVEY RESULTS] The 2024 edition of State of Software Modernization market report is published!
GET IT here

Automating Mobile CI/CD: Bitrise vs GitHub Actions + Migration Study

readtime
Last updated on
November 14, 2023

A QUICK SUMMARY – FOR THE BUSY ONES

Automating Mobile CI/CD with GitHub Actions vs. Bitrise

  1. Challenge: Migrating mobile CI/CD from Bitrise to GitHub Actions for a React Native, iOS-targeted app.
  2. Workflow Overview: Standard pipeline workflow included linting, JS testing, and E2E Detox testing on the master branch.
  3. Comparing Providers: GitHub Actions and Bitrise both offer YAML configurations, but Bitrise boasts an intuitive UI workflow editor.
  4. Setting Up GitHub Actions: Create a new workflow file in the repository's designated directory for seamless automation.
  5. Setting Up Bitrise: Link your repo with Bitrise and utilize 200+ add-ons, particularly suited for Apple app building and deployment.
  6. Platform Focus: Bitrise is mobile-focused and opinionated, offering optimized solutions, while GitHub Actions is versatile yet requires more customization.
  7. Code Signing Complexity: GitHub Actions demands manual handling of code signing and Testflight, while Bitrise provides user-friendly add-ons.
  8. Automation with Fastlane: Fastlane's lanes streamline iOS app building, code signing, and provisioning profiles for both providers.
  9. Pricing Comparison: GitHub Actions offers free minutes with reduced Mac build limits and as-you-go payments, while Bitrise offers a flexible pricing structure.
  10. Decision Factors: GitHub Actions excels in Linux-based tasks but faces challenges in React Native iOS pipelines. Bitrise's UI wizard, recipes, and cost-effectiveness make it favorable, especially for tight budgets.
  11. Final Verdict: Consider Bitrise, with its intuitive setup, production-ready add-ons, and competitive pricing, for most projects, unless specific cases demand GitHub Actions' unopinionated nature.

TABLE OF CONTENTS

Automating Mobile CI/CD: Bitrise vs GitHub Actions + Migration Study

Background

Some time ago we had a client that asked us to migrate his whole mobile CI/CD flow from Bitrise to GitHub actions. The project was a React Native, iOS-targeted application.

After finding the client’s motivations behind the decision (like having all pipelines in one place and reducing their list of vendors) and quick research, since it was our first time setting up mobile pipelines in GitHub Actions we accepted the challenge. What are the outcomes? Was it a good decision?

The workflow

The client’s pipeline workflow was pretty standard.

On each push to the repository or when the PR was opened we were first linting the code, and then testing the JS part.

Additionally on the master branch E2E Detox tests were executed. We also had the possibility to run the manual workflows for E2E and deployment.

Apple to oranges?

Both of the providers support YAML configurations where you can specify the workflows.

But Bitrise also supports the UI workflow editor. I heard the opinions that UI editors are for amateurs only, providing basic functionalities only but seriously the editor speeds up the configuration process significantly.

Let’s configure our repo to support both CI/CD providers. How can it be done?

In GitHub Actions, we need to create a new workflow file in ./github/workflows directory. It could look like this:

And voilà we have a GitHub Action workflow that can be run either on push to all branches or manually.

Now let’s see how it looks in Bitrise. Since it is another service first we need to connect it with the repo. It has a wizard that leads you through the whole process. Just a couple of dialogs / settings and you have a primary but working pipeline that we can customize.

You can utilize over 200 add-ons that are used as workflow steps, with integrations for Apple app building and deployment included. This is important because it allows configuring these steps in a much more accessible way than in GitHub.

The wizard can also automatically connect with GitHub API so that the pipeline starts on push and reports the status back.

The workflow is also available as a YAML configuration:

The crucial difference between the providers is related to their targets. GitHub Actions is a generic solution that is totally unopinionated, there are multiple shared actions available in the marketplace and you can configure it as you wish however there’s no recipe that you can quickly adapt to your project.

Bitrise however is mobile-focused, and opinionated, providing the recipes that should speed up the configuration.

My subjective feeling is that Bitrise solutions are significantly better documented, you have the aforementioned recipes, and so on. On the other hand, GitHub Actions as iOS CI is rather a niche - for instance, Detox docs don’t even say a thing about GitHub Actions configurations, whereas different providers are described. However it’s doable, we have successfully set it up in our client’s project.

Code signing

Each time setting up the pipelines for iOS development the most problematic part to me is the code signing and Testflight part.

How to store the certificate? How to sign the code? These are the questions you need to address on your own when using GH Actions.

Bitrise provides its own add-ons that can do it for you, apparently after some configuration that is usually well described in the documentation.

Returning to GH Actions, we decided to automate the process using Fastlane. For those who are not familiar with this - it is an app automation tool that allows deployment-related tasks to be performed automatically by using so-called lanes.

Sample Fastlane’s lane for building the iOS app:

We used Fastlane’s cert and sigh approach that handles loading the certificates/provisioning profiles and signing the app. But first, we needed to import the certificate to the keychain which is a bit complicated if you don’t work with Mac pipelines often. A sample script might look like this:

There is also an alternative Fastlane’s approach, called match that stores the certificates and provisioning profiles in a dedicated repository, it might be GitHub or another provider.

But we decided to stick with the cert and sigh approach.

How it is done in Bitrise? Well, you just need to upload the certificates and adjust a few settings:

Pricing

A penny saved is a penny earned, so let’s compare the pricing plans.

GitHub Actions pricing strategy is based on the free minutes assigned to the account and as-you-go payments when the free limit is reached.

At first glance, you might get the impression that you get 2000 or even 3000 free minutes but beware of the operating system multiplier. Yes, you get 2000/3000 minutes as long as it’s a Linux build. If you’re going to use Mac it reduces 10 times. (But When building Android on Linux this pricing might be very generous).

Each minute beyond the free limit cost at least $0.08 for a 3-core machine and the price is the same, no matter how many minutes you spend.

GitHub pricing:

For further details check the GitHub pricing page.

Bitrise offers 300 compute minutes for free. Unlike Github the additional minutes don’t have a fixed price - the more you consume the less you pay. The first Team tier includes 500 minutes, $0.07 each, and the last tier includes 50 000, $0.0351 each.

Bitrise pricing:

For further details check the Bitrise pricing page.

Conclusion

GitHub Actions is definitely a stable and robust CI solution backed by the tech giant. I enjoy working with it on our projects where we’re operating on Linux and doing common, well-known tasks. But React Native iOS pipeline is a different story, though - it is a bit challenging to set up and that’s not bad at all - we, software developers, like challenges, isn’t it? But the fact that in Bitrise the pipeline can be set up in the UI wizard with the guidance of recipes on production-ready add-ons and in most cases for a lower price makes it a no-brainer decision.

There might be some cases where GitHub Actions’ unopinionated and low-level traits may shine however in most cases I would suggest using Bitrise, especially if you’re working on an MVP project where deadlines and budgets are pretty tight.

Frequently Asked Questions

No items found.

Our promise

Every year, Brainhub helps 750,000+ founders, leaders and software engineers make smart tech decisions. We earn that trust by openly sharing our insights based on practical software engineering experience.

Authors

Tomasz Pierzchała
github
JavaScript Software Engineer

Full-stack software engineer with 8 years of professional experience. Graduate of The Silesian University of Technology.

Read next

No items found...

Get smarter in engineering and leadership in less than 60 seconds.

Join 300+ founders and engineering leaders, and get a weekly newsletter that takes our CEO 5-6 hours to prepare.

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.