Publish OAK App workflow (luxonis/oak-examples)
The Publish OAK App workflow from luxonis/oak-examples, explained and optimized by Latchkey.
CI health: A - excellent
Run this on Latchkey for self-healing, caching, and up to 58% lower cost.
Grade your own workflow free or run it on Latchkey →What it does
This is the Publish OAK App workflow from the luxonis/oak-examples repository, a real project running GitHub Actions. It is shown here with attribution under its Apache-2.0 license.
Below, Latchkey shows a faster, safer version produced by its optimization engine.
The workflow
name: Publish OAK App
on:
workflow_dispatch:
inputs:
root_dir:
description: "Path to the example root containing oakapp.toml."
type: string
required: true
new_identifier:
description: "Override whole identifier value in oakapp.toml. By default only `com.example` will be replaced by `com.luxonis`"
type: string
required: false
jobs:
publish:
runs-on: ['self-hosted', 'testbed-runner']
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.12
cache: pip
- name: Install HIL
run: |
pip install hil_framework --upgrade --index-url https://__token__:${{ secrets.GITLAB_TOKEN }}@gitlab.luxonis.com/api/v4/projects/213/packages/pypi/simple
- name: Publish app via HIL runner
env:
ROOT_DIR: ${{ inputs.root_dir }}
NEW_IDENTIFIER: ${{ inputs.new_identifier }}
OAKCTL_HUB_TOKEN: ${{ secrets.OAKCTL_HUB_TOKEN }}
run: |
export RESERVATION_NAME="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}#publish-oakapp"
ENV_VARS="\
--env ROOT_DIR=$ROOT_DIR \
--env NEW_IDENTIFIER=$NEW_IDENTIFIER \
--env OAKCTL_HUB_TOKEN=$OAKCTL_HUB_TOKEN"
exec hil_runner --models "oak4_pro or oak4_d" --reservation-name "$RESERVATION_NAME" --wait --oakctl --sync-workspace \
--dockerfile ./.github/ci/publish_oakapp/Dockerfile \
--docker-run-args "$ENV_VARS"
The same workflow, on Latchkey
Removes redundant runs and caps runaway jobs. Added and changed lines are highlighted.
name: Publish OAK App on: workflow_dispatch: inputs: root_dir: description: "Path to the example root containing oakapp.toml." type: string required: true new_identifier: description: "Override whole identifier value in oakapp.toml. By default only `com.example` will be replaced by `com.luxonis`" type: string required: false jobs: publish: timeout-minutes: 30 runs-on: ['self-hosted', 'testbed-runner'] steps: - name: Checkout code uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v5 with: python-version: 3.12 cache: pip - name: Install HIL run: | pip install hil_framework --upgrade --index-url https://__token__:${{ secrets.GITLAB_TOKEN }}@gitlab.luxonis.com/api/v4/projects/213/packages/pypi/simple - name: Publish app via HIL runner env: ROOT_DIR: ${{ inputs.root_dir }} NEW_IDENTIFIER: ${{ inputs.new_identifier }} OAKCTL_HUB_TOKEN: ${{ secrets.OAKCTL_HUB_TOKEN }} run: | export RESERVATION_NAME="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}#publish-oakapp" ENV_VARS="\ --env ROOT_DIR=$ROOT_DIR \ --env NEW_IDENTIFIER=$NEW_IDENTIFIER \ --env OAKCTL_HUB_TOKEN=$OAKCTL_HUB_TOKEN" exec hil_runner --models "oak4_pro or oak4_d" --reservation-name "$RESERVATION_NAME" --wait --oakctl --sync-workspace \ --dockerfile ./.github/ci/publish_oakapp/Dockerfile \ --docker-run-args "$ENV_VARS"
What changed
- Add a job timeout so a hung step cannot burn hours of runner time.
What Latchkey heals here
This workflow has steps that commonly fail on transient issues (network, registries, flaky browsers). On Latchkey managed runners they are detected, retried, and self-healed instead of failing your build:
- Dependency installs
This workflow runs 1 job per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.