-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
enable image build on push for gmc (#141)
Signed-off-by: Yingchun Guo <[email protected]>
- Loading branch information
1 parent
ac6c247
commit f8a2954
Showing
1 changed file
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# Copyright (C) 2024 Intel Corporation | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
name: Build latest images on push event | ||
|
||
on: | ||
push: | ||
branches: ["main"] | ||
paths: | ||
- microservices-connector/** | ||
- "!**.md" | ||
- "!**.txt" | ||
- "!**.png" | ||
- "!.**" | ||
- .github/workflows/image-build-on-push.yml | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }}-on-push | ||
cancel-in-progress: true | ||
|
||
env: | ||
GOSRC_DIR: "microservices-connector" | ||
|
||
jobs: | ||
image-build: | ||
strategy: | ||
matrix: | ||
platform: [xeon, gaudi] | ||
runs-on: docker-build-${{ matrix.platform }} | ||
steps: | ||
- name: Checkout out Repo | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set variables | ||
id: set_variables | ||
run: | | ||
echo "DOCKER_REGISTRY=${OPEA_IMAGE_REPO}opea" >> $GITHUB_ENV | ||
echo "VERSION=latest" >> $GITHUB_ENV | ||
echo "DOCKER_REGISTRY=${OPEA_IMAGE_REPO}opea" >> $GITHUB_OUTPUT | ||
echo "VERSION=latest" >> $GITHUB_OUTPUT | ||
- name: Build image and push | ||
run: | | ||
cd $GOSRC_DIR | ||
make docker.build | ||
make docker.push | ||
- name: Clean up images | ||
if: always() | ||
run: | | ||
# clean up the images | ||
docker rmi ${{ env.DOCKER_REGISTRY }}/gmcrouter:${{ env.VERSION }} | ||
docker rmi ${{ env.DOCKER_REGISTRY }}/gmcmanager:${{ env.VERSION }} | ||
echo y | docker image prune |