Skip to content

Commit 78331ee

Browse files
Add nightly image build and publish action (#1067)
Signed-off-by: chensuyue <suyue.chen@intel.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 7f7ad0e commit 78331ee

File tree

1 file changed

+65
-0
lines changed

1 file changed

+65
-0
lines changed
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Copyright (C) 2024 Intel Corporation
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
name: Nightly build/publish latest docker images
5+
6+
on:
7+
schedule:
8+
- cron: "30 1 * * *"
9+
workflow_dispatch:
10+
11+
env:
12+
examples: "AgentQnA,AudioQnA,ChatQnA,CodeGen,CodeTrans,DocIndexRetriever,DocSum,FaqGen,InstructionTuning,MultimodalQnA,ProductivitySuite,RerankFinetuning,SearchQnA,Translation,VideoQnA,VisualQnA"
13+
node: gaudi
14+
tag: latest
15+
publish_tags: latest
16+
17+
jobs:
18+
get-build-matrix:
19+
runs-on: ubuntu-latest
20+
outputs:
21+
examples: ${{ steps.get-matrix.outputs.examples }}
22+
steps:
23+
- name: Create Matrix
24+
id: get-matrix
25+
run: |
26+
examples=($(echo ${{ env.examples }} | tr ',' ' '))
27+
examples_json=$(printf '%s\n' "${examples[@]}" | sort -u | jq -R '.' | jq -sc '.')
28+
echo "examples=$examples_json" >> $GITHUB_OUTPUT
29+
30+
build:
31+
needs: get-build-matrix
32+
strategy:
33+
matrix:
34+
example: ${{ fromJSON(needs.get-build-matrix.outputs.examples) }}
35+
fail-fast: false
36+
uses: ./.github/workflows/_example-workflow.yml
37+
with:
38+
node: ${{ env.node }}
39+
example: ${{ matrix.example }}
40+
inject_commit: true
41+
secrets: inherit
42+
43+
get-image-list:
44+
uses: ./.github/workflows/_get-image-list.yml
45+
with:
46+
examples: ${{ env.examples }}
47+
48+
publish:
49+
needs: [get-image-list, build]
50+
strategy:
51+
matrix:
52+
image: ${{ fromJSON(needs.get-image-list.outputs.matrix) }}
53+
runs-on: "docker-build-${{ env.node }}"
54+
steps:
55+
- uses: docker/login-action@v3.2.0
56+
with:
57+
username: ${{ secrets.DOCKERHUB_USER }}
58+
password: ${{ secrets.DOCKERHUB_TOKEN }}
59+
60+
- name: Image Publish
61+
uses: opea-project/validation/actions/image-publish@main
62+
with:
63+
local_image_ref: ${OPEA_IMAGE_REPO}opea/${{ matrix.image }}:${{ env.tag }}
64+
image_name: opea/${{ matrix.image }}
65+
publish_tags: ${{ env.publish_tags }}

0 commit comments

Comments
 (0)