Skip to content

Commit

Permalink
Enhance manually run image build workflow (#271)
Browse files Browse the repository at this point in the history
Signed-off-by: Yingchun Guo <[email protected]>
  • Loading branch information
daisy-ycguo authored Aug 6, 2024
1 parent 833dcec commit e983c32
Showing 1 changed file with 19 additions and 9 deletions.
28 changes: 19 additions & 9 deletions .github/workflows/image-build-on-manual.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,34 +8,44 @@ on:
inputs:
registry:
default: ""
description: "Registry to store images"
description: "Registry to store images, default is empty"
required: false
type: string
tag:
default: "latest"
description: "Tag to apply to images"
required: true
type: string
node:
default: "[docker-build-xeon, docker-build-gaudi]"
description: "Node to run the build on [docker-build-xeon, docker-build-gaudi]"
nodes:
default: "docker-build-xeon, docker-build-gaudi"
description: "List of nodes to run the build on"
required: true
type: string

concurrency:
group: ${{ github.workflow }}-on-manual
cancel-in-progress: true

env:
GOSRC_DIR: "microservices-connector"

jobs:
get-build-matrix:
runs-on: ubuntu-latest
outputs:
nodes: ${{ steps.get-services.outputs.nodes }}
steps:
- name: Get test Services
id: get-services
run: |
set -x
node_list=($(echo ${{ github.event.inputs.nodes }} | tr ',' ' '))
nodes=$(printf '%s\n' "${node_list[@]}" | sort -u | jq -R '.' | jq -sc '.')
echo "nodes=$nodes" >> $GITHUB_OUTPUT
image-build:
strategy:
matrix:
platform: ${{ github.event.inputs.node }}
node: ${{ fromJSON(needs.get-build-matrix.outputs.nodes) }}
uses: ./.github/workflows/reuse-gmc-image-build.yaml
with:
image_repo: ${{ github.event.inputs.registry }}
image_tag: ${{ github.event.inputs.tag }}
runner_label: ${{ matrix.platform }}
runner_label: ${{ matrix.node }}

0 comments on commit e983c32

Please sign in to comment.