cicd: post verify api
All checks were successful
Docker Build and Push / docker (push) Successful in 1m46s

This commit is contained in:
aiyueqi
2026-04-21 15:39:32 +08:00
parent 9287689915
commit 001c4bed06
2 changed files with 36 additions and 0 deletions

View File

@@ -23,6 +23,22 @@ jobs:
echo "IMAGE_NAME=${IMAGE_NAME}" >> "$GITEA_ENV"
echo "IMAGE=${IMAGE}" >> "$GITEA_ENV"
- name: Load and Validate Task Info
run: |
set -a
. ./task_info.env
set +a
for name in FRAMEWORK GPU_TYPE TASK_TYPE; do
eval "value=\${${name}:-}"
if [ -z "$value" ]; then
echo "${name} is empty in task_info.env"
exit 1
fi
echo "${name}=${value}" >> "$GITEA_ENV"
done
- name: Login to Docker Registry
run: |
echo "$DOCKER_PASSWORD" | docker login "$DOCKER_REGISTRY" \
@@ -56,3 +72,20 @@ jobs:
echo "docker push failed after 3 attempts"
exit 1
- name: Notify Image Verify
run: |
if [ -z "${FIXED_TOKEN:-}" ]; then
echo "FIXED_TOKEN is not configured on runner"
exit 1
fi
curl --fail-with-body --location --request POST 'https://modelhub.org.cn//adminApi/image-verify' \
--header "Xc-Token: ${FIXED_TOKEN}" \
--header 'Content-Type: application/json' \
--data-raw "{
\"framework\": \"${FRAMEWORK}\",
\"gpuType\": \"${GPU_TYPE}\",
\"imageUrl\": \"${IMAGE}\",
\"taskType\": \"${TASK_TYPE}\"
}"

3
task_info.env Normal file
View File

@@ -0,0 +1,3 @@
FRAMEWORK=transformers
GPU_TYPE=Iluvatar_bi-150
TASK_TYPE=vision_classification