forked from opea-project/GenAIComps
-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (55 loc) · 1.93 KB
/
schedule-image-build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
name: Build latest images on schedule event
on:
schedule:
- cron: "0 17 * * *" # 5:00 PM UTC every day, 1:00 AM CST every day
env:
tag: "latest"
jobs:
check-build:
runs-on: ubuntu-latest
outputs:
run_build: ${{ steps.get-changes.outputs.run_build }}
steps:
- name: Checkout out Repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check if build is needed
id: get-changes
run: |
set -x
changed_files=$(git log --since="24 hours ago" --name-only --pretty=format: | grep comps/cores | grep -vE '*.md') || true
if [ -z "$changed_files" ]; then
echo "No changes in the last 24 hours for the 'comps/cores' directory"
echo "run_build=false" >> $GITHUB_OUTPUT
else
echo "Changes detected in the last 24 hours for the 'comps/cores' directory"
echo "run_build=true" >> $GITHUB_OUTPUT
fi
image-build:
needs: check-build
if: ${{ needs.check-build.outputs.run_build == 'true' }}
strategy:
matrix:
service:
["asr", "dataprep", "embeddings", "guardrails", "llms", "reranks", "retrievers", "tts", "web_retrievers"]
node: ["docker-build-xeon", "docker-build-gaudi"]
runs-on: ${{ matrix.node }}
continue-on-error: true
steps:
- name: Clean Up Working Directory
run: |
sudo rm -rf ${{github.workspace}}/*
- name: Checkout out Repo
uses: actions/checkout@v4
- name: Build image
env:
service: ${{ matrix.service }}
uses: opea-project/validation/actions/image-build@main
with:
work_dir: ${{ github.workspace }}
docker_compose_path: ${{ github.workspace }}/.github/workflows/docker/compose/${service}-compose.yaml
registry: ${OPEA_IMAGE_REPO}
tag: ${tag}