---
title: Trigger builds from the Expo GitHub App
sidebar_title: Trigger builds from GitHub App
description: Learn how to trigger builds on EAS for your app using the Expo GitHub App.
---

import ImageSpotlight from '~/components/plugins/ImageSpotlight';

You can trigger builds on EAS for your app from a CI environment such as GitHub Actions, Travis CI, and more.

Before building with EAS on CI, you'll need to install and configure `eas-cli`. Then, you can trigger new builds with the `eas build` command.

## Prerequisites

> **warning** While in preview, this feature is only available to EAS subscribers.

### Run a successful build from your local machine

To trigger EAS builds from a GitHub repo, you'll need to configure your project for EAS Build and successfully run a build from your computer for each platform that you'd like to support on GitHub.

If you have run `eas build -p [all|ios|android]` successfully before, then you can continue. If you haven't done this yet, refer to the [Create your first build](setup.mdx) and return here when ready.

## Configure your app for GitHub

### Link your GitHub repository to your Expo project

Visit your project's [GitHub settings
page](https://expo.dev/accounts/[account]/projects/[projectName]/github).

<ImageSpotlight
  alt="The project GitHub settings page"
  src="/static/images/eas-build/build-from-github/project-github-page.png"
/>

Install the Expo GitHub App on your GitHub account.

<ImageSpotlight
  alt="The GitHub app installation UI"
  src="/static/images/eas-build/build-from-github/install-github-app.png"
/>

Link your GitHub account to your Expo account.

> **Note:** You must be an admin of the Expo account to install the app. Also, You can only link GitHub
> organizations to Expo organizations.

<ImageSpotlight
  alt="The GitHub account linking UI"
  src="/static/images/eas-build/build-from-github/link-github-account.png"
/>

Then, you'll be able to link your repository to your Expo project.

<ImageSpotlight
  alt="The repository selector on the Expo project GitHub settings page"
  src="/static/images/eas-build/build-from-github/connect-a-repository.png"
/>

### Configure your repository settings

Before you run a build, the Expo GitHub App needs to know where to find the source code for your project. If your Expo
project source code is in the root of your repository, then you don't need to do anything. If your
Expo project source code is in a subdirectory, then you'll need to configure "Base directory"
settings for your repository on your project's [GitHub settings
page](https://expo.dev/accounts/[account]/projects/[projectName]/github).

<ImageSpotlight
  alt="The base directory input on the Expo project GitHub settings page"
  src="/static/images/eas-build/build-from-github/specify-base-directory.png"
/>

## Trigger a build from GitHub

Once you've configured your app for GitHub, you can trigger a build from GitHub by using the UI on
your project's build list page or by labels on your GitHub PRs.

### Build using the Expo website

Visit your project's [build list
page](https://expo.dev/accounts/[account]/projects/[projectName]/builds) and click the "Build from
GitHub" button. You'll be prompted to select a Git ref (branch/commit/tag), a platform to build
for, and the build profile to apply to it.

You can also specify a base directory for this specific build. That will not change the global
settings for this project.

<ImageSpotlight
  alt="The build from GitHub UI on the Expo project builds list page"
  src="/static/images/eas-build/build-from-github/github-build-ui.png"
/>

### Build using GitHub PR labels

You can trigger a build from a GitHub PR by adding a label to the PR. The label must be in the form
of `eas-build-[platform]:[profile]` where `[platform]` is either `android`, `ios`, or `all` and
`[profile]` is the name of a build profile specified in your **eas.json** file. If you don't specify
a build platform, it will default to `all`. If you don't speficy
a build profile, it will default to `production`.

For example, if
you want to trigger a production build for Android, add the label `eas-build-android` to the PR.

<ImageSpotlight
  alt="A PR with the eas-build label and live status checks"
  src="/static/images/eas-build/build-from-github/eas-build-label.png"
/>

The build will be triggered for the latest commit on the PR's base branch. You can view the status
of the build in the PR's checks. A link to the build will be available in the check's details.

<ImageSpotlight
  alt="EAS Build check details on a GitHub PR"
  src="/static/images/eas-build/build-from-github/gh-check-details.png"
/>
