Beginner’s Guide to CI/CD with Fastlane, GitHub, and React Native 0.81.4
Hey folks 👋,
If you’re diving into React Native CLI 0.81.4 and wondering how to get those smooth automated builds for Android & iOS, then let’s talk about setting up CI/CD with Fastlane + GitHub Actions. Trust me—this will save you from late-night manual builds and release chaos.
This is a simple, beginner-friendly guide—straight from my hands-on dev notes.
Why CI/CD in React Native?
What You’ll Need
🛠 Step 1: Setup Your Project
npx react-native init MyApp --version 0.81.4
cd MyApp
git init
git remote add origin https://github.com/your-username/MyApp.git
git push -u origin main
Step 2: Fastlane Installation
Inside iOS and Android folders:
iOS
cd ios
bundle init
bundle add fastlane
bundle exec fastlane init
Android
cd android
bundle init
bundle add fastlane
bundle exec fastlane init
This will generate a Fastfile where you define your automation.
Step 3: Add Fastlane Lanes
Here’s a starter Fastfile:
platform :ios do
desc "Build iOS app"
lane :build do
build_app(scheme: "MyApp")
end
end
platform :android do
desc "Build Android app"
lane :build do
gradle(task: "assembleRelease")
end
end
Step 4: Setup GitHub Actions
Create: .github/workflows/ci.yml
name: React Native CI/CD
on:
push:
branches:
- main
jobs:
build:
runs-on: macos-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install Dependencies
run: yarn install
- name: iOS Build
run: |
cd ios
bundle exec fastlane build
- name: Android Build
run: |
cd android
bundle exec fastlane build
Testing & Deployment
Quick Takeaways
References & Useful Reads
Pro Tip: Split your workflows—one for PR validation, one for nightly builds, and one for production. Cleaner pipelines, happier devs.
Next time, I’ll show how to auto-deploy to App Store & Play Store (yes, real publishing magic).