---
title: Native Builds with GitHub Actions
description: Trigger Capawesome Cloud native iOS and Android builds from GitHub Actions — using the official cloud-build-action or the Capawesome CLI.
---

# GitHub Actions

Trigger native builds from [GitHub Actions](https://github.com/features/actions){:target="_blank"}. The build itself runs in Capawesome Cloud, so the workflow only needs to start it — using the official **Capawesome Cloud Build Action** (recommended) or the [Capawesome CLI](../../cli/index.md).

## Prerequisites

Create an [API token](../../accounts/tokens.md) in Capawesome Cloud and store it as a repository secret named `CAPAWESOME_TOKEN`.

## Workflow

=== "GitHub Action"

    The official [`cloud-build-action`](https://github.com/capawesome-team/cloud-build-action){:target="_blank"} starts the build in a single step and exposes the build number and URL as outputs:

    ```yaml title=".github/workflows/native-build.yml"
    name: Native Build
    on:
      workflow_dispatch:
        inputs:
          platform:
            description: "Platform (ios or android)"
            required: true
    jobs:
      build:
        runs-on: ubuntu-latest
        steps:
          - uses: capawesome-team/cloud-build-action@v0.1.0
            with:
              appId: "00000000-0000-0000-0000-000000000000"
              platform: ${{ inputs.platform }}
              gitRef: ${{ github.sha }}
              token: ${{ secrets.CAPAWESOME_TOKEN }}
    ```

    The action exposes all the build options as inputs — including `type`, `certificate`, `environment`, `channel`/`destination`, and artifact downloads (`apk`/`aab`/`ipa`/`zip`). See the [action README](https://github.com/capawesome-team/cloud-build-action){:target="_blank"} for the full list.

    To share the build with testers after it succeeds, set the `share` input (with optional `shareDescription` and `shareExpiresInDays`) and read the `shareUrl`, `shareQrCodeUrl`, and `shareExpiresAt` outputs — for example to post a pull request comment with the QR code and link. See [Share a build](../share-a-build.md#share-automatically-after-a-build).

=== "CLI"

    Prefer full control, or running on a non-GitHub CI? Use the [Capawesome CLI](../../cli/index.md) directly:

    ```yaml title=".github/workflows/native-build.yml"
    name: Native Build
    on:
      workflow_dispatch:
        inputs:
          platform:
            description: "Platform (android, ios, or web)"
            required: true
    jobs:
      build:
        runs-on: ubuntu-latest
        steps:
          - run: npx @capawesome/cli login --token ${{ secrets.CAPAWESOME_TOKEN }}
          - run: |
              npx @capawesome/cli apps:builds:create \
                --app-id 00000000-0000-0000-0000-000000000000 \
                --platform ${{ inputs.platform }} \
                --git-ref ${{ github.sha }} \
                --yes
    ```

Pin the action (or the CLI version) to a specific release for reproducible runs, and prefer `workflow_dispatch` so builds run when you choose. To attach a signing certificate or environment, pass the relevant inputs — see the [action README](https://github.com/capawesome-team/cloud-build-action){:target="_blank"} or the [CLI reference](../../cli/commands.md#appsbuildscreate).
