Files
wehub-resource-sync 593b94c120
pytest / Unit Tests (push) Has been cancelled
pytest / Integration (integration_tests_a) (push) Has been cancelled
pytest / Integration (integration_tests_b) (push) Has been cancelled
pytest / Integration (integration_tests_c) (push) Has been cancelled
pytest / Integration (integration_tests_d) (push) Has been cancelled
pytest / Integration (integration_tests_e) (push) Has been cancelled
pytest / Integration (integration_tests_f) (push) Has been cancelled
pytest / Integration (integration_tests_g) (push) Has been cancelled
pytest / Integration (integration_tests_h) (push) Has been cancelled
pytest / Integration (integration_tests_i) (push) Has been cancelled
pytest / Integration (integration_tests_j) (push) Has been cancelled
pytest / Distributed (distributed_a) (push) Has been cancelled
pytest / Distributed (distributed_b) (push) Has been cancelled
pytest / Distributed (distributed_c) (push) Has been cancelled
pytest / Distributed (distributed_d) (push) Has been cancelled
pytest / Distributed (distributed_e) (push) Has been cancelled
pytest / Distributed (distributed_f) (push) Has been cancelled
pytest / Minimal Install (push) Has been cancelled
pytest / Event File (push) Has been cancelled
pytest (slow) / py-slow (push) Has been cancelled
Publish JSON Schema / publish-schema (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 12:49:20 +08:00

87 lines
2.7 KiB
YAML

name: docker
on:
push:
tags: ["v*.*.*"]
workflow_dispatch:
inputs:
ludwig_version:
description: "PyPI version to install, e.g. 0.13.0 (leave empty to build from source)"
required: false
default: ""
latest:
description: "Also tag as :latest"
required: false
type: boolean
default: false
jobs:
docker:
name: Build docker image ${{ matrix.docker-image }}
if: github.repository == 'ludwig-ai/ludwig'
runs-on: ubuntu-latest
# cancel in-progress runs for the same branch/tag
concurrency:
group: docker-${{ matrix.docker-image }}-${{ inputs.ludwig_version || github.head_ref || github.sha }}
cancel-in-progress: true
strategy:
fail-fast: false
matrix:
docker-image:
- ludwig
- ludwig-gpu
- ludwig-ray
- ludwig-ray-gpu
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Derive minor version tag
id: version
if: inputs.ludwig_version != ''
run: |
minor=$(echo "${{ inputs.ludwig_version }}" | cut -d. -f1-2)
echo "minor=${minor}" >> "$GITHUB_OUTPUT"
- name: Docker meta
id: meta
uses: docker/metadata-action@v6
with:
images: |
ludwigai/${{ matrix.docker-image }}
tags: |
# versioned dispatch: use explicit PyPI version tags
type=raw,value=${{ inputs.ludwig_version }},enable=${{ inputs.ludwig_version != '' }}
type=raw,value=${{ steps.version.outputs.minor }},enable=${{ inputs.ludwig_version != '' }}
type=raw,value=latest,enable=${{ inputs.ludwig_version != '' && inputs.latest }}
# tag push: derive tags from git ref
type=semver,pattern={{version}},enable=${{ inputs.ludwig_version == '' }}
type=semver,pattern={{major}}.{{minor}},enable=${{ inputs.ludwig_version == '' }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v4
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v7
with:
context: .
file: ./docker/${{ matrix.docker-image }}/Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
LUDWIG_VERSION=${{ inputs.ludwig_version }}