GitLab CI/CD
Automatically upload your build artifacts (binaries, hex files, map files, etc.) to EmbedHub projects directly from your GitLab CI/CD pipelines.
This is the GitLab equivalent of the GitHub Action — a
reusable CI/CD component that runs the EmbedHub CLI's push command as a job.
Features
- Upload firmware binaries, hex files, map files, and other build artifacts
- Support for glob patterns to upload multiple files
Quick Start
1. Create an EmbedHub API Key
- Log in to your EmbedHub account
- Go to your settings
- Navigate to the "API Keys" tab
- Create a new API key and copy it
2. Add a CI/CD Variable
Add your API key as a masked CI/CD variable:
- Go to Settings → CI/CD → Variables → Add variable
- Key:
EMBEDHUB_API_KEY - Value: your EmbedHub API key
- Tick Mask variable (and Protect variable if you only deploy from protected branches/tags)
The API key is read from the EMBEDHUB_API_KEY variable, not passed as a
component input — inputs are not secret.
3. Use in Your Pipeline
Add the component to your .gitlab-ci.yml after your build job:
include:
- component: $CI_SERVER_FQDN/embedhub/gitlab-ci/upload@main
inputs:
organization: mycompany
project: my-firmware
files: build/*.bin
This generates a job named embedhub-upload in the deploy stage.
Usage Examples
Upload Firmware Binary
include:
- component: $CI_SERVER_FQDN/embedhub/gitlab-ci/upload@main
inputs:
organization: mycompany
project: iot-device
files: firmware.bin
Upload Multiple Files with Glob Pattern
include:
- component: $CI_SERVER_FQDN/embedhub/gitlab-ci/upload@main
inputs:
organization: mycompany
project: embedded-app
files: build/*.{bin,hex,map,elf}
Upload to Specific Path
include:
- component: $CI_SERVER_FQDN/embedhub/gitlab-ci/upload@main
inputs:
organization: mycompany
project: sensor-firmware
files: dist/*.bin
path: releases/$CI_COMMIT_TAG/
Upload from Subdirectory
include:
- component: $CI_SERVER_FQDN/embedhub/gitlab-ci/upload@main
inputs:
organization: mycompany
project: motor-controller
files: '*.hex'
working_directory: ./build/output
Run Only on Tags
The job runs in whatever pipeline includes it. To restrict the pipeline to tags,
add a workflow rule:
workflow:
rules:
- if: $CI_COMMIT_TAG
include:
- component: $CI_SERVER_FQDN/embedhub/gitlab-ci/upload@main
inputs:
organization: mycompany
project: sensor-firmware
files: dist/*.bin
path: releases/$CI_COMMIT_TAG/
Inputs
| Input | Required | Description | Default |
|---|---|---|---|
organization | Yes | Organization slug (e.g. mycompany or username) | - |
project | Yes | Project slug (e.g. my-firmware) | - |
files | Yes | Files to upload (supports glob: *.bin, build/*.{hex,map}) | - |
path | No | Target path in project (e.g. releases/$CI_COMMIT_TAG/) | Auto-detected |
working_directory | No | Directory to run the upload from | . |
stage | No | Pipeline stage for the job | deploy |
job_name | No | Name of the generated job | embedhub-upload |
image | No | Image the job runs in (needs curl + bash, or apt/apk) | debian:bookworm-slim |
cli_url | No | URL to download the EmbedHub CLI (linux-amd64) | CDN default |
The API key is supplied via the EMBEDHUB_API_KEY CI/CD variable, not an input.
Default File Paths
When path is not specified, files are uploaded to these default locations based
on file type:
| File Type | Extensions | Default Path |
|---|---|---|
| Release Files | .bin, .hex, .elf, .map | releases/ |
| Images | .jpg, .png, .svg, .webp, .gif, .mp4, .mov, .webm | photos/ |
| Documents | .pdf | documents/ |
| Other Files | All others | Root directory |