mirror of
https://github.com/hanzo-ml/katib.git
synced 2026-09-24 00:31:27 +00:00
[feature] migrate docker images to ghcr (#2520)
* update custom action Signed-off-by: mahdikhashan <[email protected]> * define token as input Signed-off-by: mahdikhashan <[email protected]> * clean up meta job Signed-off-by: mahdikhashan <[email protected]> * change build-and-publish-imageg.yaml Signed-off-by: mahdikhashan <[email protected]> * remove secret from workflow call Signed-off-by: mahdikhashan <[email protected]> * remove docker credentials from publish* images Signed-off-by: mahdikhashan <[email protected]> * revert meta step changes Signed-off-by: mahdikhashan <[email protected]> * revert changes Signed-off-by: mahdikhashan <[email protected]> * update Signed-off-by: mahdikhashan <[email protected]> * add dockerhub as a job Signed-off-by: mahdikhashan <[email protected]> * revert secrets Signed-off-by: mahdikhashan <[email protected]> * revert docker secrets Signed-off-by: mahdikhashan <[email protected]> * revert docker secrets Signed-off-by: mahdikhashan <[email protected]> * consolidate/merge registeries Signed-off-by: mahdikhashan <[email protected]> * fix inputs Signed-off-by: mahdikhashan <[email protected]> * revert docker path name Signed-off-by: mahdikhashan <[email protected]> --------- Signed-off-by: mahdikhashan <[email protected]>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
# Reusable workflows for publishing Katib images.
|
||||
name: Build And Publish Images
|
||||
name: Build and Publish Images
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
@@ -21,31 +21,50 @@ on:
|
||||
|
||||
jobs:
|
||||
build-and-publish:
|
||||
name: Publish Image
|
||||
name: Build and Publish Images
|
||||
runs-on: ubuntu-22.04
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Docker Login
|
||||
# Trigger workflow only for kubeflow/katib repository with specific branch (master, release-.*) or tag (v.*).
|
||||
if: >-
|
||||
github.repository == 'kubeflow/katib' &&
|
||||
(github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release-') || startsWith(github.ref, 'refs/tags/v'))
|
||||
- name: Set Publish Condition
|
||||
id: publish-condition
|
||||
shell: bash
|
||||
run: |
|
||||
if [[ "${{ github.repository }}" == 'kubeflow/katib' && \
|
||||
( "${{ github.ref }}" == 'refs/heads/master' || \
|
||||
"${{ github.ref }}" =~ ^refs/heads/release- || \
|
||||
"${{ github.ref }}" =~ ^refs/tags/v ) ]]; then
|
||||
echo "should_publish=true" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "should_publish=false" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: GHCR Login
|
||||
if: steps.publish-condition.outputs.should_publish == 'true'
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: DockerHub Login
|
||||
if: steps.publish-condition.outputs.should_publish == 'true'
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: docker.io
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Publish Component ${{ inputs.component-name }}
|
||||
# Trigger workflow only for kubeflow/katib repository with specific branch (master, release-.*) or tag (v.*).
|
||||
if: >-
|
||||
github.repository == 'kubeflow/katib' &&
|
||||
(github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release-') || startsWith(github.ref, 'refs/tags/v'))
|
||||
if: steps.publish-condition.outputs.should_publish == 'true'
|
||||
id: publish
|
||||
uses: ./.github/workflows/template-publish-image
|
||||
with:
|
||||
image: docker.io/kubeflowkatib/${{ inputs.component-name }}
|
||||
image: |
|
||||
ghcr.io/kubeflow/katib/${{ inputs.component-name }}
|
||||
docker.io/kubeflowkatib/${{ inputs.component-name }}
|
||||
dockerfile: ${{ inputs.dockerfile }}
|
||||
platforms: ${{ inputs.platforms }}
|
||||
push: true
|
||||
@@ -54,7 +73,9 @@ jobs:
|
||||
if: steps.publish.outcome == 'skipped'
|
||||
uses: ./.github/workflows/template-publish-image
|
||||
with:
|
||||
image: docker.io/kubeflowkatib/${{ inputs.component-name }}
|
||||
image: |
|
||||
ghcr.io/kubeflow/katib/${{ inputs.component-name }}
|
||||
docker.io/kubeflowkatib/${{ inputs.component-name }}
|
||||
dockerfile: ${{ inputs.dockerfile }}
|
||||
platforms: ${{ inputs.platforms }}
|
||||
push: false
|
||||
|
||||
Reference in New Issue
Block a user