|
| 1 | +--- |
| 2 | +slug: /deployment/deploy-from-github |
| 3 | +title: Deploy from GitHub |
| 4 | +description: Learn how to deploy your apps directly from GitHub branch. |
| 5 | +tags: [Apple App Store, Google Play Store, Deployment, GitHub] |
| 6 | +sidebar_position: 5 |
| 7 | +keywords: [Apple App Store, Google Play Store, Deployment, GitHub] |
| 8 | +--- |
| 9 | + |
| 10 | +You can deploy your FlutterFlow app directly from a GitHub repository. This is especially useful when you are managing your app’s code on GitHub. Managing code on GitHub enables you to add custom features or advanced functionality that may not be fully supported by FlutterFlow's capabilities. |
| 11 | + |
| 12 | +Deploying from GitHub is particularly beneficial when: |
| 13 | + |
| 14 | +- You have written custom code that cannot be managed directly in FlutterFlow, such as features that require advanced Flutter functionality. |
| 15 | +- You want to manage the source code in an external GitHub repository for better version control. |
| 16 | +- You want to automate the process of deploying your app directly from GitHub to the Play Store or App Store after modifying the code. |
| 17 | +- You need full control over your project’s code and want to deploy a specific branch of your GitHub repository. |
| 18 | + |
| 19 | +## Steps to Deploy |
| 20 | + |
| 21 | +To deploy from a GitHub repository: |
| 22 | + |
| 23 | +1. If you haven't already added your project to the GitHub repository, follow the instructions provided [here](../exporting-code/push-to-github.md#connect-a-github-repo). |
| 24 | +2. In FlutterFlow, go to **Settings & Integrations > App Settings > Mobile Deployment.** |
| 25 | +3. Locate the **Deployment Source** section and click the arrow icon on the right to expand it. |
| 26 | +4. Turn on the toggle for **Use GitHub repo: [your repo URL]**. |
| 27 | +5. Enter the branch name of your repository that contains the code you want to deploy. Ensure the branch name is correct. |
| 28 | +6. Click the **Deploy to App Store** or **Deploy to Play Store** button, depending on your desired platform for deployment. |
| 29 | + |
| 30 | + |
| 31 | + |
| 32 | +:::info[important] |
| 33 | + |
| 34 | +When deploying from your GitHub branch, you will need to manage the app versioning manually. This is done through the `pubspec.yaml` file. For example, to set the version to **1.1.0** and the build number to **2**, you can use the format: `version: 1.1.0+2`. Learn more about app versioning [**here**](#). |
| 35 | + |
| 36 | + |
| 37 | + |
| 38 | +::: |
| 39 | + |
| 40 | +## FAQs |
| 41 | + |
| 42 | +<details> |
| 43 | +<summary>I am having an issue while Deploying from a GitHub branch. Error: *You uploaded an APK or Android App Bundle that was signed in debug mode. You need to sign your APK or Android App Bundle in release mode.*</summary> |
| 44 | +<p> |
| 45 | + |
| 46 | +If you are experiencing problems deploying or uploading to the Google Play Store from a Github branch, check to make sure your `build.gradle` file is correct. |
| 47 | + |
| 48 | +1. Open your `android/app/build.gradle` file. |
| 49 | +2. Ensure your file has these lines of code: |
| 50 | + |
| 51 | + ``` |
| 52 | + def keystoreProperties = new Properties() |
| 53 | + def keystorePropertiesFile = rootProject.file('key.properties') |
| 54 | + if (keystorePropertiesFile.exists()) { |
| 55 | + keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) |
| 56 | + } |
| 57 | + signingConfigs { |
| 58 | + release { |
| 59 | + keyAlias keystoreProperties['keyAlias'] |
| 60 | + keyPassword keystoreProperties['keyPassword'] |
| 61 | + storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null |
| 62 | + storePassword keystoreProperties['storePassword'] |
| 63 | + } |
| 64 | + } |
| 65 | + ``` |
| 66 | +
|
| 67 | +3. Newer Flutterflow code will automatically have these lines added. If yours doesn't, you can push it to your `flutterflow` branch on GitHub and merge in the changes or add them like so: |
| 68 | +
|
| 69 | +  |
| 70 | +
|
| 71 | +
|
| 72 | +4. Lastly, change `debug` (shown in the red box above) to `release` before deploying. |
| 73 | +</p> |
| 74 | +</details> |
0 commit comments