Skip to main content

5 posts tagged with "Tutorial"

Step-by-step guides and tutorials

View All Tags

Automate Mobile CI/CD with GitHub Actions and Source Push

· 4 min read
Hebert
FullStack Software Developer | Node.js, Laravel, React.js, React Native

Manual mobile releases are slow, error-prone, and hard to scale—especially when your team supports multiple apps, channels, and environments.

In this guide, you’ll build a practical CI/CD pipeline using GitHub Actions + Source Push so OTA updates become predictable, auditable, and fast.

Why automate OTA delivery?

When releases depend on local machines, teams often face:

  • Inconsistent environments
  • Credential sprawl
  • Missing release history
  • Slow rollback and promotion workflows

A GitHub Actions pipeline solves this by centralizing execution and secrets, while Source Push handles channel-based delivery.

What we’re building

A pipeline with three stages:

  1. Validate: run tests/lint checks.
  2. Release to Staging: publish OTA update to a staging channel.
  3. Promote to Production: manually approve promotion when validation succeeds.

This gives you speed and control.

Prerequisites

Before you start, make sure you have:

  • A React Native project configured for Source Push
  • Source Push app/channels created (for example: Staging, Production)
  • A CI token stored in GitHub Secrets (for example: SOURCE_PUSH_TOKEN)
  • Optional: app name in secrets (SOURCE_PUSH_APP)

Step 1: Add CI secrets in GitHub

In your GitHub repository, go to Settings → Secrets and variables → Actions, and add:

  • SOURCE_PUSH_TOKEN: token for Source Push CLI authentication
  • SOURCE_PUSH_APP: Source Push app identifier (optional but recommended)

Keep channel names as workflow inputs or repository variables so they’re easier to change later.

Step 2: Create the GitHub Actions workflow

Create .github/workflows/mobile-ota.yml:

name: Mobile OTA CI/CD

on:
workflow_dispatch:
inputs:
target_channel:
description: "Target release channel"
required: true
default: "Staging"
description:
description: "Release notes"
required: true
default: "OTA update from CI"

jobs:
validate:
name: Validate
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm

- name: Install dependencies
run: npm ci

- name: Run tests
run: npm test -- --passWithNoTests

release_staging:
name: Release OTA
runs-on: ubuntu-latest
needs: validate
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm

- name: Install dependencies
run: npm ci

- name: Install Source Push CLI
run: npm install -g source-push-cli

- name: Source Push Login
run: srcpush login --token "${{ secrets.SOURCE_PUSH_TOKEN }}"

- name: Release React Native OTA
run: |
srcpush release-react "${{ secrets.SOURCE_PUSH_APP }}" \
--deployment "${{ github.event.inputs.target_channel }}" \
--description "${{ github.event.inputs.description }}"

promote_production:
name: Promote to Production
runs-on: ubuntu-latest
needs: release_staging
if: ${{ github.event.inputs.target_channel == 'Staging' }}
environment: production
steps:
- name: Install Source Push CLI
run: npm install -g source-push-cli

- name: Source Push Login
run: srcpush login --token "${{ secrets.SOURCE_PUSH_TOKEN }}"

- name: Promote Staging to Production
run: |
srcpush promote "${{ secrets.SOURCE_PUSH_APP }}" Staging Production

Step 3: Protect production with environment approvals

Use GitHub Environments so production promotion requires explicit approval:

  1. Go to Settings → Environments → New environment
  2. Create production
  3. Add required reviewers
  4. (Optional) Add environment-scoped secrets

Now your pipeline can auto-release to staging while keeping a human checkpoint for production.

Step 4: Add branch-based automation (optional)

You can trigger staging releases on main pushes and keep production as manual approval:

on:
push:
branches: [main]
workflow_dispatch:

A common pattern:

  • push to main → release to Staging
  • Manual approval in production environment → promote to Production

Operational best practices

To make this reliable at scale:

  • Use small, frequent OTA updates
  • Include clear release descriptions tied to commit SHA
  • Keep rollback commands documented and tested
  • Restrict token scope and rotate credentials
  • Track adoption/health metrics before production promotion

Fast rollback pattern

If production metrics degrade, rollback should be one command away:

srcpush rollback MyApp Production

You can also automate rollback by integrating monitoring alerts into a follow-up workflow.

Final thoughts

CI/CD for mobile OTA updates is less about “more tooling” and more about reducing operational risk.

With GitHub Actions and Source Push, your team gets:

  • Repeatable releases
  • Better governance
  • Faster incident response
  • A deploy process that scales as your app portfolio grows

Start with one app and two channels (Staging and Production). Once stable, templatize the workflow and roll it out across every mobile project.

Introducing the srcpush-bare-rn-setup Codex Skill (beta)

· 2 min read
Hebert
FullStack Software Developer | Node.js, Laravel, React.js, React Native

If you can describe your React Native setup goals, you should be able to get a production-ready Source Push integration without digging through scattered docs.

That is exactly why we created srcpush-bare-rn-setup, our Codex skill for Bare React Native projects:

👉 https://github.com/srcpush/srcpush-bare-rn-setup

Setting up the Source Push CLI for Over-the-Air Updates

· One min read
Hebert
FullStack Software Developer | Node.js, Laravel, React.js, React Native

The Source Push CLI makes it easy to manage your OTA deployments from the command line. To get started:

npm install -g srcpush
srcpush login --accessKey <your-access-key>

After logging in, you can create deployments and release updates to your users.

For more detailed usage examples, see the CLI documentation.

Advanced Deployment Strategies with Source Push

· 2 min read
Hebert
FullStack Software Developer | Node.js, Laravel, React.js, React Native

Deploying updates to your React Native app requires careful planning and execution. In this guide, we'll explore different deployment strategies available with Source Push and when to use them.

Understanding Deployment Environments

Source Push supports multiple deployment environments out of the box:

# Create staging and production deployments
srcpush deployment add MyApp Staging
srcpush deployment add MyApp Production

This allows you to test updates before rolling them out to all users.

Staged Rollouts

Staged rollouts help minimize the impact of potential issues by gradually releasing updates to users:

# Release to 25% of users initially
srcpush release-react MyApp ios --rollout 25

# Once confident, increase to 100%
srcpush deployment history MyApp Production
srcpush rollout MyApp Production v5 100

A/B Testing

Test different versions of your app with specific user segments:

# Release version A
srcpush release-react MyApp ios -d Production-A

# Release version B
srcpush release-react MyApp ios -d Production-B

Automatic Rollbacks

Source Push includes automatic rollback protection:

srcpush release-react MyApp ios --rollback-enabled true

This will automatically roll back if an update causes crashes above your defined threshold.

Best Practices

  1. Always Test in Staging

    srcpush release-react MyApp ios -d Staging
    # Verify in staging before promoting
    srcpush promote MyApp Staging Production
  2. Monitor Update Metrics

    • Track download success rates
    • Monitor crash reports
    • Watch adoption rates
  3. Version Targeting

    srcpush release-react MyApp ios --target-binary-version "~1.2.3"
  4. Emergency Updates

    srcpush release-react MyApp ios --mandatory true

CI/CD Integration

Automate your deployments with our CI/CD integrations:

# GitHub Actions example
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Source Push CLI
run: npm install -g @srcpush/code-push-cli
- name: Release Update
run: srcpush release-react MyApp ios -d Staging
env:
SRCPUSH_TOKEN: ${{ secrets.SRCPUSH_TOKEN }}

Monitoring Deployments

Keep track of your deployments using our monitoring tools:

# Check deployment history
srcpush deployment history MyApp Production

# View specific deployment details
srcpush deployment info MyApp Production

Conclusion

Effective deployment strategies are crucial for maintaining app stability and user satisfaction. Source Push provides all the tools you need to implement sophisticated deployment workflows that match your team's needs.

For more detailed information, check out our deployment documentation and CI/CD integration guides.

Migrating from CodePush to Source Push - A Complete Guide

· 3 min read
Hebert
FullStack Software Developer | Node.js, Laravel, React.js, React Native

With Microsoft's announcement about App Center's CodePush service retirement in March 2025, many teams are looking for alternatives. This guide will walk you through migrating your React Native app from CodePush to Source Push with minimal disruption.

Why Source Push?

Before diving into the migration process, here's why Source Push is the ideal choice:

  • Drop-in Replacement: Compatible with existing CodePush SDK
  • Performance: 3.5x faster update delivery
  • Cost-Effective: Up to 70% cost savings
  • Feature Parity+: All CodePush features plus additional capabilities

Migration Steps

1. Install Source Push CLI

First, install our CLI tool:

npm install -g @srcpush/code-push-cli

2. Create Source Push Account

Sign up at console.srcpush.com and create your organization.

3. Register Your App

# Log in to Source Push
srcpush login

# Register your app
srcpush app add MyApp

# Add deployment environments
srcpush deployment add MyApp Staging
srcpush deployment add MyApp Production

4. Update SDK Configuration

iOS (Info.plist)

<key>CodePushServerURL</key>
<string>https://api.srcpush.com</string>

Android (strings.xml)

<string moduleConfig="true" name="CodePushServerUrl">https://api.srcpush.com</string>

5. Update Deployment Keys

Replace your CodePush deployment keys with Source Push keys:

# Get your deployment keys
srcpush deployment ls MyApp -k

# Update keys in your app configuration

6. Test the Migration

  1. Release a Test Update

    srcpush release-react MyApp ios -d Staging
  2. Verify Update Download

    srcpush deployment history MyApp Staging

7. Update CI/CD Pipeline

Update your CI/CD configuration to use Source Push:

# Before (CodePush)
- name: Deploy to CodePush
run: appcenter codepush release-react -a owner/MyApp -d Staging

# After (Source Push)
- name: Deploy to Source Push
run: srcpush release-react MyApp ios -d Staging
env:
SRCPUSH_TOKEN: ${{ secrets.SRCPUSH_TOKEN }}

Migration Checklist

✅ Install Source Push CLI
✅ Create Source Push account
✅ Register app and create deployments
✅ Update SDK configuration
✅ Replace deployment keys
✅ Test update delivery
✅ Update CI/CD pipelines
✅ Monitor metrics after migration

Best Practices During Migration

  1. Gradual Rollout

    • Start with staging environment
    • Use staged rollouts for production
    srcpush release-react MyApp ios -d Production --rollout 25
  2. Version Targeting

    • Target specific app versions during transition
    srcpush release-react MyApp ios --target-binary-version ">=1.2.3"
  3. Monitoring

    • Monitor update metrics closely
    • Set up alerts for any issues
    • Keep deployment history for rollback capability

Common Issues and Solutions

Update Not Downloading

Check server URL configuration:

srcpush deployment info MyApp Production

Authentication Issues

Verify token and permissions:

srcpush login
srcpush whoami

CI/CD Integration

Test authentication in CI environment:

srcpush login --accessKey <your-access-key>

Need Help?

Our support team is ready to help with your migration:

  1. Check our migration documentation
  2. Contact [email protected]

Next Steps

After completing the migration:

  1. Set up monitoring and alerts
  2. Configure automatic rollbacks
  3. Explore advanced features like A/B testing
  4. Review our deployment strategies guide

Start your migration today and ensure a smooth transition before App Center's CodePush retirement.