Skip to content

Updated App Store deployment info #174

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
---
slug: /deployment/deploy-from-github
title: Deploy from GitHub
description: Learn how to deploy your apps directly from GitHub branch.
tags: [Apple App Store, Google Play Store, Deployment, GitHub]
sidebar_position: 5
keywords: [Apple App Store, Google Play Store, Deployment, GitHub]
---

If your FlutterFlow project is connected to a GitHub repository, the generated code can be pushed to GitHub, giving you full control over your project’s code. Then, you can deploy your app directly from the same repository, rather than deploying through FlutterFlow.

Deploying from GitHub is particularly beneficial when:

- You have written custom code that cannot be managed directly in FlutterFlow, such as features that require advanced Flutter functionality.
- You want to manage the source code in an external GitHub repository for better version control.
- You want to automate the process of deploying your app directly from GitHub to the Play Store or App Store after modifying the code.
- You want to deploy from a specific branch of your GitHub repository.

## Steps to Deploy

To deploy from a GitHub repository:

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).
2. In FlutterFlow, go to **Settings & Integrations > App Settings > Mobile Deployment.**
3. Locate the **Deployment Source** section and click the arrow icon on the right to expand it.
4. Turn on the toggle for **Use GitHub repo: [your repo URL]**.
5. Enter the branch name of your repository that contains the code you want to deploy. Ensure the branch name is correct.
6. Click the **Deploy to App Store** or **Deploy to Play Store** button, depending on your desired platform for deployment.

![deploy-from-github](../imgs/deploy-from-github.png)

:::info[important]

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`.

![update-version.avif](../imgs/update-version.avif)

:::

## FAQs

<details>
<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>
<p>

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.

1. Open your `android/app/build.gradle` file.
2. Ensure your file has these lines of code:

```
def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword keystoreProperties['storePassword']
}
}
```

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:

![deploy-github-issue](../imgs/deploy-github-issue.avif)


4. Lastly, change `debug` (shown in the red box above) to `release` before deploying.
</p>
</details>
Original file line number Diff line number Diff line change
Expand Up @@ -314,57 +314,19 @@ You can now deploy directly from FlutterFlow or from your GitHub repository.

:::info

- Every time you deploy, we'll auto increment the 'Build Number' (i.e., version code in Android). If needed, you can update the **App Version** and **Build Number** yourself.
- Every time you deploy, we'll auto increment the **Build Number** (i.e., version code in Android) to ensure that each release is identifiable. If needed, you can update the *App Version* and *Build Number* yourself.
- We'll [**auto-generate**](https://developer.android.com/studio/publish/app-signing#generate-key) and [**sign**](https://developer.android.com/studio/publish/app-signing#sign_release) your app for the release with the Keystore (i.e., upload key). If you wish to download the keystore, click the orange key button.

:::

<Tabs>
<TabItem value="FF" label="Deploy From FlutterFlow" default>
Ensure the **Google Play Track** is set to **Internal** and hit the **Deloy to Play Store** again. On successful deployment, you will see the status as 'finished'.
Ensure the **Google Play Track** is set to **Internal** and hit the **Deloy to Play Store** again. On successful deployment, you will see the status as 'finished'.

![deploy-flutterflow](../imgs/deploy-flutterflow.avif)

</TabItem>
<TabItem value="GitHub" label="Deploy From Github">

[Connecting the Github](../exporting-code/push-to-github.md) repo allows you to introduce the custom code into your FlutterFlow project. You may want to deploy the modified code directly from your Github repo to Play Store.

To deploy from Github repo:

1. If you haven't added the Github repo yet, you can do so using the instructions [here](../exporting-code/push-to-github.md).
2. Navigate to **Settings & Integrations > App Settings >** **Mobile** **Deployment**.
3. Find the **Deployment Settings** section and click on the arrow icon on the right to open it.
4. Under the **Deployment Source**, enable the **Use Github repo**.
5. Enter the **Branch Name** of your repo, from which you want to deploy the code. Make sure to enter the correct branch name.

<div style={{
position: 'relative',
paddingBottom: 'calc(56.67989417989418% + 41px)', // Keeps the aspect ratio and additional padding
height: 0,
width: '100%'}}>
<iframe
src="https://www.loom.com/embed/402bba6f50a24f388930b192cce7f554?sid=3d572cc0-0296-45fd-b981-f580cee591ff"
title="Sharing a Project with a User"
style={{
position: 'absolute',
top: 0,
left: 0,
width: '100%',
height: '100%',
colorScheme: 'light'
}}
frameborder="0"
loading="lazy"
webkitAllowFullScreen
mozAllowFullScreen
allowFullScreen
allow="clipboard-write">
</iframe>
</div>

</TabItem>
</Tabs>
:::tip
If you prefer to manage your deployment process outside of FlutterFlow, such as integrating with your own CI/CD pipeline, or if you want more control over versioning and custom code management directly on GitHub. You also have the option to [**Deploy apps from your GitHub repository**](deploy-from-github.md).
:::


#### 4.4 Verify deployment
Expand Down Expand Up @@ -445,38 +407,3 @@ Watch this video if you prefer watching a video tutorial.
</iframe>
</div>

## FAQs

<details>
<summary>I am having an issue while Deploying from a GitHub branch</summary>
<p>

If you are experiencing problems deploying or uploading to the Google Play Store and are deploying from a Github branch, check to make sure your `build.gradle` file is correct.

1. Open your `android/app/build.gradle` file.
2. Ensure your file has these lines of code:

```
def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword keystoreProperties['storePassword']
}
}
```

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:

![deploy-github-issue](../imgs/deploy-github-issue.avif)


4. Lastly, change `debug` (shown in the red box above) to `release` before deploying.
</p>
</details>