Skip to content

refactor: rename example app-id livepeer-sample/* to livepeer-example/* #6

refactor: rename example app-id livepeer-sample/* to livepeer-example/*

refactor: rename example app-id livepeer-sample/* to livepeer-example/* #6

Workflow file for this run

name: Build example images
# Build each example in the matrix; publish to Docker Hub as
# livepeer/sample-<example> on main / v* tags / manual dispatch. PRs build only —
# use workflow_dispatch to pull-test a branch.
# amd64 only: Livepeer GPU work needs NVIDIA on amd64; no CUDA on arm64/Mac.
# Add an example: add its folder (with a Dockerfile) to the matrix + paths below.
on:
push:
branches: [main]
tags:
- "v*"
paths: &image_paths
- "hello-world/**"
- "echo/**"
- "tiles/**"
- ".github/workflows/images.yml"
pull_request:
paths: *image_paths
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
images:
name: ${{ matrix.example }}
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
fail-fast: false
matrix:
example: [hello-world, echo, tiles]
steps:
- uses: actions/checkout@v4
- name: Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
# Defaults to the livepeer org; set repo variable DOCKERHUB_NAMESPACE to
# publish under your own account (e.g. to test with your own Docker Hub).
images: ${{ vars.DOCKERHUB_NAMESPACE || 'livepeer' }}/sample-${{ matrix.example }}
tags: |
type=raw,value=latest,enable={{is_default_branch}}
type=sha,format=short
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=raw,value=stable,enable=${{ startsWith(github.ref, 'refs/tags/v') }}
labels: |
org.opencontainers.image.title=sample-${{ matrix.example }}
org.opencontainers.image.description=Livepeer sample app (${{ matrix.example }}) — example, not production-ready
- name: Set up Buildx
uses: docker/setup-buildx-action@v3
# Allowlist push + dispatch — any other event (PRs, incl. pull_request_target)
# is build-only and never touches the Docker Hub secret.
- name: Log in to Docker Hub
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
uses: docker/login-action@v3
with:
username: ${{ secrets.CI_DOCKERHUB_USERNAME }}
password: ${{ secrets.CI_DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: ./${{ matrix.example }}
platforms: linux/amd64
push: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha,scope=${{ matrix.example }}
cache-to: type=gha,mode=max,scope=${{ matrix.example }}