Files
modelscope/.github/workflows/docker-image.yml
2024-10-23 15:18:40 +08:00

51 lines
1.6 KiB
YAML

name: Build Docker Image
on:
workflow_dispatch:
inputs:
workflow_name:
description: 'The specific name of this build'
required: true
default: 'build'
modelscope_branch:
description: 'ModelScope branch to build from(release/x.xx)'
required: true
image_type:
description: 'The image type to build(cpu/gpu/llm)'
required: true
modelscope_version:
description: 'ModelScope version to use(x.xx.x)'
required: true
swift_branch:
description: 'SWIFT branch to use(release/x.xx)'
required: true
other_params:
description: 'Other params in --xxx xxx'
required: false
run-name: Docker-${{ inputs.modelscope_branch }}-${{ inputs.image_type }}-${{ inputs.workflow_name }}-by-@${{ github.actor }}
jobs:
build:
runs-on: [modelscope-self-hosted-us]
steps:
- name: ResetFileMode
shell: bash
run: |
# reset filemode to allow action runner to delete files
# generated by root in docker
set -e
source ~/.bashrc
sudo chown -R $USER:$USER $ACTION_RUNNER_DIR
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.modelscope_branch }}
- name: Build Docker Image
run: |
set -e
source ~/.bashrc
python docker/build_image.py --image_type ${{ github.event.inputs.image_type }} --modelscope_branch ${{ github.event.inputs.modelscope_branch }} --modelscope_version ${{ github.event.inputs.modelscope_version }} --swift_branch ${{ github.event.inputs.swift_branch }} ${{ github.event.inputs.other_params }}