Skip to main content
CI/CD lets you build firmware in GitHub and publish it to firmngin automatically. Each successful run can upload a new artifact and, depending on how you configure the workflow, start an OTA rollout to your fleet or a single device. This path is separate from manual uploads in Dashboard → Firmware → Artifacts. CI/CD uses a scoped API token so your pipeline can publish firmware without sharing your dashboard login.

Setup overview

Complete these steps in order before your first CI/CD run:
You must generate and save the API token before configuring GitHub Actions. The token is shown only once at creation time.

Step 1: Generate an API token

Every CI/CD pipeline needs a workspace API token with the Firmware OTA scope. Generate it from the dashboard first — do not skip this step.

Open Integrations

  1. Log in to firmngin.dev.
  2. Select the workspace that owns your devices or device templates.
  3. In the sidebar, open Integrations (below Billing).
The Integrations page lists existing API tokens for the workspace. If you have no tokens yet, the empty state shows a Generate Token button.

Create the token

  1. Click Generate Token (top right, or from the empty state).
  2. On the Generate API Token page, fill in:
    • Token name — a label you will recognize later (for example github-ota-production or staging-firmware).
    • Scopes — check Firmware OTA. At least one scope is required.
  3. Click Generate Token.

Copy the token immediately

After generation, firmngin shows the full token once. A warning banner reminds you that it will not be shown again.
  1. Click Copy next to the token value.
  2. Paste it into a password manager or directly into GitHub Secrets (see Step 2).
  3. Click OK to return to the Integrations list.
If you close the page without copying the token, you cannot recover it. Revoke the token and generate a new one.

Token format

Copy the entire token exactly as shown on the Generate Token screen.

Manage tokens later

From Integrations, you can:
Scope tokens to Firmware OTA only. Do not grant broader permissions than your pipeline needs.

Step 2: Add the token to GitHub

After copying the token from Step 1, store it as a GitHub secret (never as a variable or in workflow YAML).
  1. Open your firmware repository on GitHub.
  2. Go to Settings → Secrets and variables → Actions.
  3. Click New repository secret.
  4. Set:
    • Name: FIRMNGIN_API_TOKEN
    • Secret: paste the full token from Step 1
  5. Click Add secret.
Reference it in workflows as ${{ secrets.FIRMNGIN_API_TOKEN }}.

Step 3: Add GitHub Secrets and variables

Go to Settings → Secrets and variables → Actions.

Secrets (required)

Never commit keys.h to git. Add it to .gitignore and inject it in CI from the FIRMNGIN_KEYS_H secret.
Example workflow step for Arduino projects:
Place keys.h in the same folder as your .ino file.

Variables (optional)

Non-secret identifiers can live in Variables: You can also store FIRMNGIN_DEVICE_SECRET_ID as a secret (recommended) instead of a variable. See Where to find IDs below.

What CI/CD covers

Deployment modes

Choose one target mode per workflow run:
Do not combine device-template-id and device-secret-id in the same workflow run. They are mutually exclusive.

Prerequisites

Before adding CI/CD to a repository:
  1. A firmngin workspace with at least one registered device or device template.
  2. Firmware source that builds with PlatformIO (platformio.ini) or Arduino CLI (sketch folder with matching .ino filename).
  3. Board and model on your device or template must match the compiled firmware target.
  4. For fleet rollouts, a Firmware OTA policy attached to the target device template (see OTA policy).
  5. For single-device deploy, the device must have board name and board model set in the dashboard.

High-level architecture

Configure GitHub repository

This section expands Step 2 and Step 3 above. In your firmware repository, go to Settings → Secrets and variables → Actions.

Secrets

Variables

Where to find IDs

Device template ID
  1. Open Dashboard → Device templates.
  2. Open the template you use for fleet devices.
  3. Copy the template UUID from the URL or template detail panel.
Device secret ID
  1. Open Dashboard → Devices.
  2. Select your device.
  3. Copy the Secret ID shown on the device page.

Step 4: Minimal workflow

Fleet OTA (device template)

Single device (Arduino + Firmngin library)

Sketch layout for the example above:
For a sketch at the repo root instead, use arduino-sketch: path_to_your_file.ino and write keys.h to the repository root. See Arduino CLI CI/CD for both layouts. See GitHub Actions for complete workflow examples, all inputs, versioning, and troubleshooting.

Build tool guides

Upload limits and versioning

The action resolves version in this order:
  1. version input, if you set it.
  2. git describe --tags --always --dirty, if git history is available.
  3. First 12 characters of the commit SHA.
Use explicit versioning for production releases (for example 1.2.0 or 2026.07.16).

After a successful run

Security practices

  • Never commit API tokens, keys.h, or device secret keys to git.
  • Scope tokens to Firmware OTA only.
  • Revoke unused tokens from Integrations.
  • Use branch protection and required reviews on main before OTA runs.
  • Prefer canary or staged_expand policies for production fleets (see Fleet rollout).