Skip to content
This repository has been archived by the owner on Nov 29, 2024. It is now read-only.

Commit

Permalink
chore: Set up image publish workflow for feature branches (#414)
Browse files Browse the repository at this point in the history
* chore: Set up workflow for PR image publishing

* iterate

* use branch name as tag
  • Loading branch information
Rupeekshan authored and jakubhava committed Aug 26, 2024
1 parent 66fad97 commit 8a83871
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/manual-image-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Publish images from Feature Branches

on:
workflow_dispatch:

jobs:
setup_env:
uses: ./.github/workflows/setup-environment.yml

build_from_branch:
needs: setup_env
uses: ./.github/workflows/image-build.yml
secrets: inherit
with:
component_version: ${{ needs.setup_env.outputs.component_version }}

publish_from_branch:
uses: ./.github/workflows/image-publish.yml
needs: build_from_branch
secrets: inherit
with:
gar_push_enabled: true
gar_image_name: us-docker.pkg.dev/vorvan/dev/mlops/temp/h2oai-modelscoring-restscorer
ecr_push_enabled: false
image_tags: "${{ needs.setup_env.outputs.sanitized_branch_name }}"
10 changes: 10 additions & 0 deletions .github/workflows/setup-environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ on:
component_version:
description: "Gradle component version, such as 1.2.3"
value: ${{ jobs.setup_env.outputs.component_version }}
sanitized_branch_name:
description: "Branch name where / is replaced by -"
value: ${{ jobs.setup_env.outputs.sanitized_branch_name }}

jobs:
setup_env:
Expand All @@ -25,6 +28,7 @@ jobs:
release_base_version: ${{ steps.release_base_version.outputs.version }}
release_version: ${{ steps.release_version.outputs.version }}
component_version: ${{ steps.component_version.outputs.version }}
sanitized_branch_name: ${{ steps.sanitized_branch_name.outputs.name }}
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -62,3 +66,9 @@ jobs:
version=0.0.0-pr.${{ steps.commit_hash.outputs.sha }}
fi
echo "version=$version" >> $GITHUB_OUTPUT
- name: Save Sanitized Branch Name
id: sanitized_branch_name
run: |
name=$(echo ${{ github.head_ref }} | sed -r 's/\//-/g')
echo "name=$name" >> $GITHUB_OUTPUT

0 comments on commit 8a83871

Please sign in to comment.