-
Notifications
You must be signed in to change notification settings - Fork 182
65 lines (57 loc) · 1.88 KB
/
nightly-docker-build-publish.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
64
65
# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
name: Nightly build/publish latest docker images
on:
schedule:
- cron: "30 1 * * *"
workflow_dispatch:
env:
EXAMPLES: "AgentQnA,AudioQnA,ChatQnA,CodeGen,CodeTrans,DocIndexRetriever,DocSum,FaqGen,InstructionTuning,MultimodalQnA,ProductivitySuite,RerankFinetuning,SearchQnA,Translation,VideoQnA,VisualQnA"
NODE: gaudi
TAG: latest
PUBLISH_TAGS: latest
jobs:
get-build-matrix:
runs-on: ubuntu-latest
outputs:
examples: ${{ steps.get-matrix.outputs.examples }}
steps:
- name: Create Matrix
id: get-matrix
run: |
examples=($(echo ${{ env.EXAMPLES }} | tr ',' ' '))
examples_json=$(printf '%s\n' "${examples[@]}" | sort -u | jq -R '.' | jq -sc '.')
echo "examples=$examples_json" >> $GITHUB_OUTPUT
build:
needs: get-build-matrix
strategy:
matrix:
example: ${{ fromJSON(needs.get-build-matrix.outputs.examples) }}
fail-fast: false
uses: ./.github/workflows/_example-workflow.yml
with:
node: env.NODE
example: ${{ matrix.example }}
inject_commit: true
secrets: inherit
get-image-list:
uses: ./.github/workflows/_get-image-list.yml
with:
examples: env.EXAMPLES
publish:
needs: [get-image-list, build]
strategy:
matrix:
image: ${{ fromJSON(needs.get-image-list.outputs.matrix) }}
runs-on: "docker-build-${{ env.NODE }}"
steps:
- uses: docker/[email protected]
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Image Publish
uses: opea-project/validation/actions/image-publish@main
with:
local_image_ref: ${OPEA_IMAGE_REPO}opea/${{ matrix.image }}:env.TAG
image_name: opea/${{ matrix.image }}
publish_tags: env.PUBLISH_TAGS