# Builds and branches

Runway fetches up to two different kinds of builds:

* **Release Candidate** (or RC, sometimes referred to as staging)
* **production** (optional)

{% hint style="info" %}
Runway will *always* fetch RC/staging builds. Runway will *optionally* fetch production builds if app/CI settings are defined such that production builds are different than RC/staging.
{% endhint %}

A build is defined by two things: the **workflow** that produces it, and the **branch** it is built from:

`<workflow> + <branch> = build`

So, in addition to fetching RC/staging builds, Runway will fetch production builds if there’s a distinct workflow for production *or* if a distinct branch is used for production (distinct == different than the branch defined for RC/staging builds).

#### Workflow

Value set in [CI settings](https://docs.runway.team/integrations/ci-cd). Runway supports up to two different CI workflows:

* RC/staging workflow (required/primary)
* Release workflow (optional)

#### Branch

Runway assumes all builds are built from the app’s release branch(es), unless optional values are set in [Integration settings](https://docs.runway.team/using-runway/app-settings/integrations-settings):

* RC/staging branch override
* Deploy branch override

{% hint style="info" %}

* If an RC/staging branch override value is set, RC/staging builds are fetched using that branch instead of the release branch.
* If a deploy branch override value is set, production builds will be fetched, and they will use that branch.
  {% endhint %}

### Examples

Release branch: `release-branch`

#### 1.

> RC/staging workflow: deploy
>
> Release workflow: (none)
>
> Staging branch override: (none)
>
> Deploy branch override: (none)

RC/staging build = `deploy + release-branch`

Prod build = (none)

#### 2.

> RC/staging workflow: `deploy`
>
> Release workflow: `deploy-prod`
>
> Staging branch override: (none)
>
> Deploy branch override: (none)

Staging build = `deploy + release-branch`

Prod build = `deploy-prod + release-branch`

#### 3.

> RC/staging workflow: `deploy`
>
> Release workflow: (none)
>
> Staging branch override: `itunes-dist`
>
> Deploy branch override: (none)

Staging build = `deploy + itunes-dist`

Prod build = (none)

#### 4.

> RC/staging workflow: `deploy`
>
> Release workflow: (none)
>
> Staging branch override: (none)
>
> Deploy branch override: `itunes-dist`

Staging build = `deploy + release-branch`

Prod build = `deploy + itunes-dist`

#### 5.

> RC/staging workflow: `deploy`
>
> Release workflow: `deploy-prod`
>
> Staging branch override: (none)
>
> Deploy branch override: `itunes-dist`

Staging build = `deploy + release-branch`

Prod build = `deploy-prod + itunes-dist`

#### 6.

> RC/staging workflow: `deploy-rc`
>
> Release workflow: `deploy-prod`
>
> Staging branch override: `development`
>
> Deploy branch override: (none)

Staging build = `deploy-rc + development`

Prod build = `deploy-prod + release-branch`
