Skip to content

Commit

Permalink
add image build process on manual event (#270)
Browse files Browse the repository at this point in the history
Signed-off-by: Yingchun Guo <yingchun.guo@intel.com>
  • Loading branch information
daisy-ycguo authored Aug 6, 2024
1 parent 739788a commit 833dcec
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 2 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/image-build-on-manual.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

name: Build GMC latest images on manual event

on:
workflow_dispatch:
inputs:
registry:
default: ""
description: "Registry to store images"
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]"
required: true
type: string

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

env:
GOSRC_DIR: "microservices-connector"

jobs:
image-build:
strategy:
matrix:
platform: ${{ github.event.inputs.node }}
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 }}
File renamed without changes.
11 changes: 9 additions & 2 deletions .github/workflows/reuse-gmc-image-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,17 @@ jobs:

- name: Set variables
id: set_variables
env:
imagerepo: ${{ inputs.image_repo }}
run: |
echo "DOCKER_REGISTRY=${OPEA_IMAGE_REPO}opea" >> $GITHUB_ENV
if [[ -z "$imagerepo" ]]; then
echo "DOCKER_REGISTRY=${OPEA_IMAGE_REPO}opea" >> $GITHUB_ENV
echo "IMAGE_REPO=${OPEA_IMAGE_REPO}" >> $GITHUB_OUTPUT
else
echo "DOCKER_REGISTRY=${imagerepo}/opea" >> $GITHUB_ENV
echo "IMAGE_REPO=${imagerepo}/" >> $GITHUB_OUTPUT
fi
echo "VERSION=${{ inputs.image_tag }}" >> $GITHUB_ENV
echo "IMAGE_REPO=${OPEA_IMAGE_REPO}" >> $GITHUB_OUTPUT
echo "VERSION=${{ inputs.image_tag }}" >> $GITHUB_OUTPUT
- name: Build image and push
Expand Down

0 comments on commit 833dcec

Please sign in to comment.