Skip to content

Commit

Permalink
update gitaction based on branch strategy change (#322)
Browse files Browse the repository at this point in the history
Signed-off-by: jooho lee <jlee@redhat.com>
  • Loading branch information
Jooho authored Nov 29, 2024
1 parent 19480d7 commit 6e80852
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ on:
workflow_dispatch:
push:
branches:
- main
- incubating
- main
tags:
- 'latest'
- 'odh-v*'
Expand Down Expand Up @@ -40,10 +40,10 @@ jobs:

- name: Set Docker Tag
run: |
if [[ "${GITHUB_REF}" == "refs/heads/main" ]]; then
echo "TAG=stable" >> $GITHUB_ENV
elif [[ "${GITHUB_REF}" == refs/heads/incubating ]]; then
if [[ "${GITHUB_REF}" == "refs/heads/incubating" ]]; then
echo "TAG=fast" >> $GITHUB_ENV
elif [[ "${GITHUB_REF}" == refs/heads/main ]]; then
echo "TAG=stable" >> $GITHUB_ENV
elif [[ "${GITHUB_REF}" == refs/tags/odh-v* ]]; then
TAG="${GITHUB_REF#refs/tags/}"
echo "TAG=${TAG}" >> $GITHUB_ENV
Expand Down
13 changes: 8 additions & 5 deletions .github/workflows/verify-odh-model-controller-img-tag.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Check ODH Model Controller Image Tag

on:
pull_request:
branches: [main, incubating]
branches: [incubating, main]
paths:
- "config/base/params.env"

Expand All @@ -23,12 +23,15 @@ jobs:
- name: Compare image tags
id: compare-tags
run: |
if [ "${{ github.base_ref }}" == "main" ]; then
EXPECTED_TAG="stable"
elif [[ "${{ github.base_ref }}" == incubating ]]; then
if [ "${{ github.base_ref }}" == "incubating" ]; then
EXPECTED_TAG="fast"
elif [[ "${{ github.base_ref }}" == "main" ]]; then
EXPECTED_TAG="stable"
elif [[ "${GITHUB_REF}" == refs/tags/odh-v* ]]; then
TAG="${GITHUB_REF#refs/tags/}"
echo "EXPECTED_TAG=${TAG}" >> $GITHUB_ENV
else
echo "Unknown destination branch: ${{ github.base_ref }}"
echo "Unknown destination branch: ${{ github.base_ref }} or tag: ${GITHUB_REF}"
exit 1
fi
Expand Down

0 comments on commit 6e80852

Please sign in to comment.