Create and publish Docker images with specific build args workflow (open-webui/pipelines)
The Create and publish Docker images with specific build args workflow from open-webui/pipelines, explained and optimized by Latchkey.
CI health: C - fair
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 Create and publish Docker images with specific build args workflow from the open-webui/pipelines repository, a real project running GitHub Actions. It is shown here with attribution under its MIT license.
Below, Latchkey shows a faster, safer version produced by its optimization engine.
The workflow
name: Create and publish Docker images with specific build args
on:
workflow_dispatch:
push:
branches:
- main
- dev
jobs:
build-main-image:
uses: ./.github/workflows/build-docker-image.yaml
with:
image_name: ${{ github.repository }}
cache_id: main
build-cuda-image:
uses: ./.github/workflows/build-docker-image.yaml
with:
image_name: ${{ github.repository }}
cache_id: cuda
image_tag: type=raw,enable=${{ github.ref == 'refs/heads/main' }},prefix=,suffix=,value=cuda
extract_flavor: suffix=-cuda,onlatest=true
build_args: |
USE_CUDA=true
build-minimum-image:
uses: ./.github/workflows/build-docker-image.yaml
with:
image_name: ${{ github.repository }}
cache_id: minimum
image_tag: type=raw,enable=${{ github.ref == 'refs/heads/main' }},prefix=,suffix=,value=minimum
extract_flavor: suffix=-minimum,onlatest=true
build_args: |
MINIMUM_BUILD=true
merge-main-images:
uses: ./.github/workflows/merge-docker-images.yaml
needs: [build-main-image]
with:
image_name: ${{ github.repository }}
cache_id: main
merge-cuda-images:
uses: ./.github/workflows/merge-docker-images.yaml
needs: [build-cuda-image]
with:
image_name: ${{ github.repository }}
cache_id: cuda
extract_flavor: suffix=-cuda,onlatest=true
extract_tags: type=raw,enable=${{ github.ref == 'refs/heads/main' }},prefix=,suffix=,value=cuda
merge-minimum-images:
uses: ./.github/workflows/merge-docker-images.yaml
needs: [build-minimum-image]
with:
image_name: ${{ github.repository }}
cache_id: minimum
extract_flavor: suffix=-minimum,onlatest=true
extract_tags: type=raw,enable=${{ github.ref == 'refs/heads/main' }},prefix=,suffix=,value=minimum
The same workflow, on Latchkey
Removes redundant runs and caps runaway jobs. Added and changed lines are highlighted.
name: Create and publish Docker images with specific build args on: workflow_dispatch: push: branches: - main - dev concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: build-main-image: timeout-minutes: 30 uses: ./.github/workflows/build-docker-image.yaml with: image_name: ${{ github.repository }} cache_id: main build-cuda-image: timeout-minutes: 30 uses: ./.github/workflows/build-docker-image.yaml with: image_name: ${{ github.repository }} cache_id: cuda image_tag: type=raw,enable=${{ github.ref == 'refs/heads/main' }},prefix=,suffix=,value=cuda extract_flavor: suffix=-cuda,onlatest=true build_args: | USE_CUDA=true build-minimum-image: timeout-minutes: 30 uses: ./.github/workflows/build-docker-image.yaml with: image_name: ${{ github.repository }} cache_id: minimum image_tag: type=raw,enable=${{ github.ref == 'refs/heads/main' }},prefix=,suffix=,value=minimum extract_flavor: suffix=-minimum,onlatest=true build_args: | MINIMUM_BUILD=true merge-main-images: timeout-minutes: 30 uses: ./.github/workflows/merge-docker-images.yaml needs: [build-main-image] with: image_name: ${{ github.repository }} cache_id: main merge-cuda-images: timeout-minutes: 30 uses: ./.github/workflows/merge-docker-images.yaml needs: [build-cuda-image] with: image_name: ${{ github.repository }} cache_id: cuda extract_flavor: suffix=-cuda,onlatest=true extract_tags: type=raw,enable=${{ github.ref == 'refs/heads/main' }},prefix=,suffix=,value=cuda merge-minimum-images: timeout-minutes: 30 uses: ./.github/workflows/merge-docker-images.yaml needs: [build-minimum-image] with: image_name: ${{ github.repository }} cache_id: minimum extract_flavor: suffix=-minimum,onlatest=true extract_tags: type=raw,enable=${{ github.ref == 'refs/heads/main' }},prefix=,suffix=,value=minimum
What changed
- Cancel superseded runs when a branch or PR gets a newer push.
- Add a job timeout so a hung step cannot burn hours of runner time.
This workflow runs 6 jobs per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.