One-Click Deploy: CI/CD Pipeline for React Native Apps

How we automated iOS and Android deployments with GitHub Actions, Fastlane, and TestFlight/Play Store integration. Ship to production in 15 minutes instead of 2 hours.

AJ Patatanian
AJ Patatanian
5 min read
One-Click Deploy: CI/CD Pipeline for React Native Apps

Manual deployments are a tax on velocity. Every release for Kallie Snake used to take 2+ hours:

  1. Build iOS (20 min)
  2. Upload to TestFlight (10 min)
  3. Build Android (15 min)
  4. Upload to Play Console (10 min)
  5. Update release notes (15 min)
  6. Pray nothing breaks (remaining time)

Now? Push to main, walk away. Apps deploy in 15 minutes.

The Problem with Manual Releases

Human error compounds:

  • Forgot to bump version number
  • Built wrong environment (dev instead of prod)
  • Uploaded wrong build variant
  • Inconsistent release notes

We needed automation.

The DevOps Pipeline We Built

GitHub Actions Workflow

name: Deploy Apps
on:
  push:
    branches: [main]

jobs:
  deploy-ios:
    runs-on: macos-latest
    steps:
      - uses: actions/checkout@v3
      - name: Install dependencies
        run: npm ci
      - name: Run tests
        run: npm test
      - name: Build & deploy
        run: fastlane ios deploy
        env:
          MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
          
  deploy-android:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Install dependencies
        run: npm ci
      - name: Build & deploy
        run: fastlane android deploy
        env:
          PLAY_STORE_JSON_KEY: ${{ secrets.PLAY_STORE_KEY }}

Fastlane Configuration

iOS Lane:

lane :deploy do
  increment_build_number
  match(type: "appstore")
  gym(scheme: "KallieSnake")
  upload_to_testflight
  slack(message: "iOS build deployed!")
end

Android Lane:

lane :deploy do
  increment_version_code
  gradle(task: "bundleRelease")
  upload_to_play_store(track: "internal")
  slack(message: "Android build deployed!")
end

The Results

Before automation:

  • 2 hours per release
  • 3-5 human errors per month
  • Releases only during work hours

After automation:

  • 15 minutes per release
  • Zero deployment errors in 6 months
  • Deploy anytime (weekends, nights)

Advanced Features We Added

1. Automated Testing

- name: Run unit tests
  run: npm test
- name: Run E2E tests
  run: detox test --configuration ios.sim.release

2. Version Bumping

Semantic versioning based on commit messages:

  • feat: → Minor version bump
  • fix: → Patch version bump
  • BREAKING CHANGE: → Major version bump

3. Release Notes Generation

Auto-extract from git commits:

git log --pretty=format:"- %s" v1.2.0...HEAD

4. Slack Notifications

Team knows instantly when builds succeed/fail:

slack(
  message: "✅ iOS 1.2.3 deployed to TestFlight",
  channel: "#releases"
)

Cost Breakdown

GitHub Actions:

  • Free for public repos
  • 2,000 minutes/month free for private repos
  • Extra: $0.008/minute

Our usage: ~300 minutes/month = Free

Fastlane: Free, open source

Total: $0/month (vs $200-500/month for CircleCI/Bitrise)

Security Best Practices

1. Secrets Management

Never commit credentials. Use GitHub Secrets:

  • MATCH_PASSWORD (iOS certificate encryption)
  • PLAY_STORE_JSON_KEY (Android upload key)
  • SLACK_WEBHOOK_URL

2. Code Signing

iOS: Fastlane Match stores certs in private repo
Android: Upload keystore to GitHub Secrets (base64 encoded)

3. Branch Protection

  • Require tests to pass
  • Require code review
  • Block force pushes

The Stack

CI/CD:

  • GitHub Actions
  • Fastlane

Testing:

  • Jest (unit tests)
  • Detox (E2E tests)
  • Maestro (UI testing)

Deployment:

  • TestFlight (iOS beta)
  • Google Play Internal Track (Android beta)
  • CodePush (OTA updates)

Lessons Learned

  1. Test in CI, not locally. Your machine lies.
  2. Deploy often. Small changes = less risk.
  3. Automate everything. If you do it twice, script it.
  4. Monitor deploys. Sentry catches crashes within minutes.

Next Steps: Continuous Deployment

We're moving toward true CD:

  • Staging environment (auto-deploy every PR)
  • Feature flags (ship code, enable features gradually)
  • Automated rollback (crash rate > 1%? Auto-revert)

Want to ship apps faster?
Set Up Your DevOps Pipeline

Ready to Build Something?

Let's discuss your next project. Mobile apps, AI integration, or custom development.

Contact Us
AJ Patatanian

Written by AJ Patatanian

Senior full-stack engineer with expertise in React Native, AI/ML, and cloud architecture. Building production apps at SERA Industries.

More articles →