Skip to content

Run go mod tidy

Run go mod tidy #15

name: Build and Publish Images
on:
- push
- pull_request
jobs:
build-and-publish:
name: Build and Publish Images
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- component-name: training-operator-v2
dockerfile: cmd/training-operator.v2alpha1/Dockerfile
platforms: linux/amd64,linux/arm64,linux/ppc64le
tag-prefix: v2alpha1
- component-name: model-initializer-v2
dockerfile: cmd/initializer_v2/model/Dockerfile
platforms: linux/amd64,linux/arm64
tag-prefix: v2
- component-name: dataset-initializer-v2
dockerfile: cmd/initializer_v2/dataset/Dockerfile
platforms: linux/amd64,linux/arm64
tag-prefix: v2
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Docker Login
# Trigger workflow only for kubeflow/training-operator repository with specific branch (master, release-*) or tag (v.*).
if: >-
github.repository == 'kubeflow/training-operator' &&
(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/training-operator repository with specific branch (master, release-*) or tag (v.*).
if: >-
github.repository == 'kubeflow/training-operator' &&
(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 }}
tag-prefix: ${{ matrix.tag-prefix }}
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 }}
tag-prefix: ${{ matrix.tag-prefix }}
push: false