mirror of
https://github.com/milvus-io/milvus.git
synced 2026-07-21 02:05:41 +00:00
issue: #47809 --------- Signed-off-by: xiaofanluan <xiaofan.luan@zilliz.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
100 lines
3.6 KiB
YAML
100 lines
3.6 KiB
YAML
name: Publish Builder
|
|
# TODO: do not trigger action for some document file update
|
|
|
|
# This workflow is triggered on pushes or pull request to the repository.
|
|
on:
|
|
push:
|
|
# file paths to consider in the event. Optional; defaults to all.
|
|
paths:
|
|
- 'build/docker/builder/cpu/**'
|
|
- '.github/workflows/publish-builder.yaml'
|
|
- '!**.md'
|
|
pull_request:
|
|
# file paths to consider in the event. Optional; defaults to all.
|
|
paths:
|
|
- 'build/docker/builder/cpu/**'
|
|
- '.github/workflows/publish-builder.yaml'
|
|
- '!**.md'
|
|
workflow_dispatch:
|
|
inputs:
|
|
push_to_dockerhub:
|
|
description: 'Push to Docker Hub'
|
|
required: true
|
|
type: boolean
|
|
default: false
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
|
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
|
|
|
jobs:
|
|
publish-builder:
|
|
name: ${{ matrix.arch }} ${{ matrix.os }}
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 500
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [ubuntu24.04, ubuntu22.04, amazonlinux2023, rockylinux9]
|
|
env:
|
|
OS_NAME: ${{ matrix.os }}
|
|
IMAGE_ARCH: ${{ matrix.arch }}
|
|
steps:
|
|
- name: Maximize build space
|
|
uses: easimon/maximize-build-space@master
|
|
if: ${{ ! startsWith(runner.name, 'self') }} # skip this step if it is self-hosted runner
|
|
with:
|
|
root-reserve-mb: 10240
|
|
overprovision-lvm: 'true'
|
|
swap-size-mb: 2048
|
|
remove-dotnet: 'true'
|
|
remove-android: 'true'
|
|
remove-haskell: 'true'
|
|
remove-codeql: 'true'
|
|
remove-docker-images: 'true'
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
- name: Get version from system time after release step
|
|
id: extracter
|
|
run: |
|
|
echo "::set-output name=version::$(date +%Y%m%d)"
|
|
echo "::set-output name=sha_short::$(git rev-parse --short=7 HEAD)"
|
|
- name: Docker meta
|
|
id: meta
|
|
uses: docker/metadata-action@v5
|
|
with:
|
|
images: |
|
|
milvusdb/milvus-env
|
|
tags: |
|
|
type=raw,enable=true,value=${{ matrix.os }}-{{date 'YYYYMMDD'}}-{{sha}}
|
|
type=raw,enable=true,value=${{ matrix.os }}-latest
|
|
# - name: Setup upterm session
|
|
# uses: lhotari/action-upterm@v1
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v3
|
|
with:
|
|
platforms: arm64
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
- name: Login to Docker Hub
|
|
if: github.event_name != 'pull_request' && (github.event_name != 'workflow_dispatch' || inputs.push_to_dockerhub)
|
|
uses: docker/login-action@v3
|
|
with:
|
|
username: ${{ secrets.DOCKERHUB_USER }}
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
- name: Build and push
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: .
|
|
platforms: linux/amd64,linux/arm64
|
|
push: ${{ github.event_name != 'pull_request' && (github.event_name != 'workflow_dispatch' || inputs.push_to_dockerhub) }}
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
file: build/docker/builder/cpu/${{ matrix.os }}/Dockerfile
|
|
- name: Bump Builder Version
|
|
uses: ./.github/actions/bump-builder-version
|
|
if: success() && github.event_name == 'push' && github.repository == 'milvus-io/milvus' && matrix.os == 'ubuntu22.04'
|
|
with:
|
|
tag: "${{ steps.extracter.outputs.version }}-${{ steps.extracter.outputs.sha_short }}"
|
|
type: cpu
|
|
token: ${{ secrets.ALL_CONTRIBUTORS_TOKEN }}
|