Adding v2 trainjob validation webhook #24
This file contains hidden or 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
| name: Build and Publish Images | |
| on: | |
| - push | |
| - pull_request | |
| jobs: | |
| build-and-publish: | |
| name: Build and Publish Images | |
| runs-on: | |
| labels: ubuntu-latest-16-cores | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - component-name: trainer-controller-manager | |
| dockerfile: cmd/trainer-controller-manager/Dockerfile | |
| platforms: linux/amd64,linux/arm64,linux/ppc64le | |
| - component-name: model-initializer | |
| dockerfile: cmd/initializer/model/Dockerfile | |
| platforms: linux/amd64,linux/arm64 | |
| - component-name: dataset-initializer | |
| dockerfile: cmd/initializer/dataset/Dockerfile | |
| platforms: linux/amd64,linux/arm64 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Docker Login | |
| # Trigger workflow only for kubeflow/trainer repository with specific branch (master, release-*) or tag (v.*). | |
| if: >- | |
| github.repository == 'kubeflow/trainer' && | |
| (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release-') || startsWith(github.ref, 'refs/tags/v')) | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Publish Component ${{ matrix.component-name }} | |
| # Trigger workflow only for kubeflow/trainer repository with specific branch (master, release-*) or tag (v.*). | |
| if: >- | |
| github.repository == 'kubeflow/trainer' && | |
| (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release-') || startsWith(github.ref, 'refs/tags/v')) | |
| id: publish | |
| uses: ./.github/workflows/template-publish-image | |
| with: | |
| image: docker.io/kubeflow/${{ matrix.component-name }} | |
| dockerfile: ${{ matrix.dockerfile }} | |
| platforms: ${{ matrix.platforms }} | |
| context: ${{ matrix.context }} | |
| push: true | |
| - name: Test Build For Component ${{ matrix.component-name }} | |
| if: steps.publish.outcome == 'skipped' | |
| uses: ./.github/workflows/template-publish-image | |
| with: | |
| image: docker.io/kubeflow/${{ matrix.component-name }} | |
| dockerfile: ${{ matrix.dockerfile }} | |
| platforms: ${{ matrix.platforms }} | |
| context: ${{ matrix.context }} | |
| push: false |