CI/CD automation with CodePush and GitHub Actions

We’re happy to announce that Revopush now offers a GitHub Action that lets you use all the CLI commands to build and release React Native bundles — automating your deployment process with ease! In this article, we’ll walk you through setting up and using the Revopush GitHub Action.

Prerequisites

You must be either a Repository Owner or have Admin permissions for the repository to store Revopush access key into secrets. If you don’t see the option to add secrets, check your role in the repository or ask the owner or admin to grant you the necessary permissions.

How to configure the Revopush GitHub Action

  • Login to Revopush UI and add a new access key (Settings -> Add new key).
  • Give meaningful name to the key (eg GH_REVOPUSH_ACCESS_KEY ) to never revoke it by mistake.
  • Default value of access key TTL (time to live) is set to 60 days, and you can set it to any value you want. Also keep in mind that in CLI users can extend the TTL of the key by name:

    $ revopush access-key patch "GH_REVOPUSH_ACCESS_KEY" --ttl 128d

  • Store access key as a repository or organization secret in GitHub (Settings -> Secrets and variables -> Action -> New repository secret).
  • Once you've checked out your app's source code and installed the necessary dependencies, you can run any commands available in the Revopush CLI.
  • Below is an example workflow that uses the Revopush GitHub Action to release React Native bundles for Android and iOS platforms, specifically for the Staging deployment:
    on:
      workflow_dispatch:
    
    jobs:
      job_id:
        runs-on: ubuntu-latest
        steps:
          - name: Checkout
            uses: actions/checkout@v4
          - name: Tools cache
            id: tool-caches
            uses: actions/cache@v4
            with:
              path: /opt/hostedtoolcache/revopush
              key: revopush-${{ runner.os }}-${{ github.run_id }}
              restore-keys: |
                revopush-${{ runner.os }}-
          - uses: actions/setup-node@v4
            with:
              node-version: '20'
          - name: Setup Revopush CLI
            uses: 'revopush/[email protected]'
            id: setup-revopush-cli
            with:
              version: 'latest'
              accessKey: ${{ secrets.GH_REVOPUSH_ACCESS_KEY }}
          - name: Install dependencies
            run: npm ci
          - name: Release Android bundle
            run: revopush release-react myAmazingAndroidApp android -d Staging
          - name: Release ios bundle
            run: revopush release-react myAmazingIOSApp ios -d Staging
        

Additional resources

For any questions, please contact our support team. Give a try and let us know what do you think.

Join Revopush!

Avoid last-minute headaches!