|
15 | 15 | type: string
|
16 | 16 |
|
17 | 17 | jobs:
|
18 |
| - build-and-publish: |
19 |
| - name: Publish Image |
| 18 | + build-and-publish-to-ghcr: |
| 19 | + name: Publish Image to Github Container Registry |
20 | 20 | runs-on: ubuntu-22.04
|
21 | 21 | steps:
|
22 | 22 | - name: Checkout
|
|
54 | 54 | dockerfile: ${{ inputs.dockerfile }}
|
55 | 55 | platforms: ${{ inputs.platforms }}
|
56 | 56 | push: false
|
| 57 | + |
| 58 | + build-and-publish-to-dockerhub: |
| 59 | + name: Publish Image to DockerHub |
| 60 | + runs-on: ubuntu-22.04 |
| 61 | + steps: |
| 62 | + - name: Checkout |
| 63 | + uses: actions/checkout@v4 |
| 64 | + |
| 65 | + - name: DockerHub Login |
| 66 | + if: >- |
| 67 | + github.repository == 'kubeflow/katib' && |
| 68 | + (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release-') || startsWith(github.ref, 'refs/tags/v')) |
| 69 | + uses: docker/login-action@v3 |
| 70 | + with: |
| 71 | + registry: docker.io |
| 72 | + username: ${{ secrets.DOCKERHUB_USERNAME }} |
| 73 | + password: ${{ secrets.DOCKERHUB_TOKEN }} |
| 74 | + |
| 75 | + - name: Publish Component ${{ inputs.component-name }} |
| 76 | + if: >- |
| 77 | + github.repository == 'kubeflow/katib' && |
| 78 | + (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release-') || startsWith(github.ref, 'refs/tags/v')) |
| 79 | + id: publish |
| 80 | + uses: ./.github/workflows/template-publish-image |
| 81 | + with: |
| 82 | + image: docker.io/kubeflow/katib/${{ inputs.component-name }} |
| 83 | + dockerfile: ${{ inputs.dockerfile }} |
| 84 | + platforms: ${{ inputs.platforms }} |
| 85 | + push: true |
| 86 | + |
| 87 | + - name: Test Build For Component ${{ inputs.component-name }} |
| 88 | + if: steps.publish.outcome == 'skipped' |
| 89 | + uses: ./.github/workflows/template-publish-image |
| 90 | + with: |
| 91 | + image: ghcr.io/kubeflow/katib/${{ inputs.component-name }} |
| 92 | + dockerfile: ${{ inputs.dockerfile }} |
| 93 | + platforms: ${{ inputs.platforms }} |
| 94 | + push: false |
0 commit comments