38
38
build-images :
39
39
runs-on : " docker-build-${{ inputs.node }}"
40
40
continue-on-error : true
41
+ outputs :
42
+ file_exists : ${{ steps.get-yaml-path.outputs.file_exists }}
41
43
steps :
42
44
- name : Clean Up Working Directory
43
45
run : sudo rm -rf ${{github.workspace}}/*
@@ -51,10 +53,23 @@ jobs:
51
53
cd ${{ github.workspace }}/.github/workflows/docker/compose
52
54
# service=$(echo ${{ inputs.service }} | cut -d'_' -f1)
53
55
if [[ "${{ inputs.mode }}" == "CD" ]]; then
54
- docker_compose_yml=${{ github.workspace }}/.github/workflows/docker/compose/${{ inputs.service }}-compose-cd.yaml
56
+ if [ -f "${{ github.workspace }}/.github/workflows/docker/compose/${{ inputs.service }}-compose-cd.yaml" ]; then
57
+ docker_compose_yml=${{ github.workspace }}/.github/workflows/docker/compose/${{ inputs.service }}-compose-cd.yaml
58
+ echo "file_exists=true" >> $GITHUB_OUTPUT
59
+ else
60
+ echo "There is no CD part of ${{ inputs.service }} that needs to be executed."
61
+ echo "file_exists=false" >> $GITHUB_OUTPUT
62
+ fi
55
63
else
56
- docker_compose_yml=${{ github.workspace }}/.github/workflows/docker/compose/${{ inputs.service }}-compose.yaml
64
+ if [ -f "${{ github.workspace }}/.github/workflows/docker/compose/${{ inputs.service }}-compose.yaml" ]; then
65
+ docker_compose_yml=${{ github.workspace }}/.github/workflows/docker/compose/${{ inputs.service }}-compose.yaml
66
+ echo "file_exists=true" >> $GITHUB_OUTPUT
67
+ else
68
+ echo "There is no CI part of ${{ inputs.service }} that needs to be executed."
69
+ echo "file_exists=false" >> $GITHUB_OUTPUT
70
+ fi
57
71
fi
72
+
58
73
echo "docker_compose_path=${docker_compose_yml}" >> $GITHUB_OUTPUT
59
74
if [[ $(grep -c "llava-tgi:" ${docker_compose_yml}) != 0 ]]; then
60
75
git clone https://github.com/yuanwu2017/tgi-gaudi.git && cd tgi-gaudi && git checkout v2.0.4
64
79
fi
65
80
66
81
- name : Build Image
67
- if : ${{ fromJSON(inputs.build) }}
82
+ if : ${{ fromJSON(inputs.build) && steps.get-yaml-path.outputs.file_exists == 'true' }}
68
83
uses : opea-project/validation/actions/image-build@main
69
84
with :
70
85
work_dir : ${{ github.workspace }}
77
92
# ###################################################################################################
78
93
test-service-compose :
79
94
needs : [build-images]
80
- if : ${{ fromJSON(inputs.test) }}
95
+ if : ${{ fromJSON(inputs.test) && needs.build-images.outputs.file_exists == 'true' }}
81
96
uses : ./.github/workflows/_run-docker-compose.yml
82
97
with :
83
98
tag : ${{ inputs.tag }}
0 commit comments