Docker-feat/fast_search-cpu-build-py3.12-by-@wangxingjun778 #10
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build Docker Image | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| workflow_name: | |
| description: "A descriptive name for this build run" | |
| required: true | |
| default: "build" | |
| sirchmunk_branch: | |
| description: "Sirchmunk branch to build from" | |
| required: true | |
| default: "main" | |
| image_type: | |
| description: "Image type to build (cpu)" | |
| required: true | |
| default: "cpu" | |
| sirchmunk_version: | |
| description: "Version label for image tag (empty = auto from version.py)" | |
| required: false | |
| default: "" | |
| ubuntu_version: | |
| description: "Ubuntu version label for image tag" | |
| required: false | |
| default: "22.04" | |
| python_version: | |
| description: "Python version for the base image" | |
| required: false | |
| default: "3.12" | |
| node_version: | |
| description: "Node.js version for the frontend build" | |
| required: false | |
| default: "20" | |
| mirror: | |
| description: "Mirror profile for builds behind GFW (cn / empty)" | |
| required: false | |
| default: "" | |
| run-name: >- | |
| Docker-${{ inputs.sirchmunk_branch }}-${{ inputs.image_type }}-${{ inputs.workflow_name }}-py${{ inputs.python_version }}-by-@${{ github.actor }} | |
| jobs: | |
| build: | |
| runs-on: self-hosted | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.event.inputs.sirchmunk_branch }} | |
| - name: Build and Push Docker Image | |
| run: | | |
| VERSION_ARG="" | |
| if [ -n "${{ github.event.inputs.sirchmunk_version }}" ]; then | |
| VERSION_ARG="--sirchmunk_version ${{ github.event.inputs.sirchmunk_version }}" | |
| fi | |
| MIRROR_ARG="" | |
| if [ -n "${{ github.event.inputs.mirror }}" ]; then | |
| MIRROR_ARG="--mirror ${{ github.event.inputs.mirror }}" | |
| fi | |
| python3 docker/build_image.py \ | |
| --image_type ${{ github.event.inputs.image_type }} \ | |
| --ubuntu_version ${{ github.event.inputs.ubuntu_version }} \ | |
| --python_version ${{ github.event.inputs.python_version }} \ | |
| --node_version ${{ github.event.inputs.node_version }} \ | |
| --sirchmunk_branch ${{ github.event.inputs.sirchmunk_branch }} \ | |
| --push \ | |
| $VERSION_ARG \ | |
| $MIRROR_ARG |