Skip to content

Commit 8325d5d

Browse files
authored
Remove duplicate code (#596)
Signed-off-by: zepan <[email protected]>
1 parent 12fd97a commit 8325d5d

File tree

1 file changed

+9
-15
lines changed

1 file changed

+9
-15
lines changed

.github/workflows/_comps-workflow.yml

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -53,24 +53,18 @@ jobs:
5353
cd ${{ github.workspace }}/.github/workflows/docker/compose
5454
# service=$(echo ${{ inputs.service }} | cut -d'_' -f1)
5555
if [[ "${{ inputs.mode }}" == "CD" ]]; then
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
56+
docker_compose_yml=${{ github.workspace }}/.github/workflows/docker/compose/${{ inputs.service }}-compose-cd.yaml
6357
else
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
58+
docker_compose_yml=${{ github.workspace }}/.github/workflows/docker/compose/${{ inputs.service }}-compose.yaml
7159
fi
72-
7360
echo "docker_compose_path=${docker_compose_yml}" >> $GITHUB_OUTPUT
61+
if [ -f "$docker_compose_yml" ]; then
62+
echo "file_exists=true" >> $GITHUB_OUTPUT
63+
else
64+
echo "There is no ${{ inputs.mode }} part of ${{ inputs.service }} that needs to be executed."
65+
echo "file_exists=false" >> $GITHUB_OUTPUT
66+
fi
67+
7468
if [[ $(grep -c "llava-tgi:" ${docker_compose_yml}) != 0 ]]; then
7569
git clone https://github.com/yuanwu2017/tgi-gaudi.git && cd tgi-gaudi && git checkout v2.0.4
7670
fi

0 commit comments

Comments
 (0)