A Simple Continuous Deployment of a React Native App to Google Play
3 min readJun 16, 2020
We will create a simple Github Action to build and deploy a React Native mobile application automatically upon pushing to a specific branch.
Pre-Requisites
- A react-native application that builds successfully.
- An active Google Play account with the desired app already deployed (Google does not allow the first deploy to be programatic).
- A JSON key file for a service account user with access to the Google Play APIs. See how to create one here. Renamed to
api.json
and placed inside theandroid
directory. - A valid App upload key. See how to create one here.
Prepare for Secret Injection
To ensure authenticity, an uploaded application needs to be signed via an upload certificate that is password protected. In order to securely provide this password to our application at compile time we need to define it in our build configuration.
Edit the release certificate configuration in android/app/build.gradle
by adding the following code block inside signingConfigs
:
release {
storeFile file('upload-key.keystore')
storePassword MYAPP_UPLOAD_STORE_PASSWORD
keyAlias 'bigdelivery-sales-app-upload-key'
keyPassword…