chore(deps): use ubi9 base images (#1328) #1
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 Push async-upload container image | |
| on: | |
| push: | |
| branches: | |
| - 'main' | |
| tags: | |
| - 'v*' | |
| paths: | |
| - 'jobs/async-upload/**' | |
| - '!LICENSE*' | |
| - '!DOCKERFILE*' | |
| - '!**.gitignore' | |
| - '!**.md' | |
| - '!**.txt' | |
| env: | |
| IMG_REGISTRY: ghcr.io | |
| IMG_ORG: kubeflow | |
| IMG_NAME: model-registry/job/async-upload | |
| REGISTRY_USER: ${{ github.actor }} | |
| REGISTRY_PWD: ${{ secrets.GITHUB_TOKEN }} | |
| jobs: | |
| build-and-push: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Log in to the Container registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.IMG_REGISTRY }} | |
| username: ${{ env.REGISTRY_USER }} | |
| password: ${{ env.REGISTRY_PWD }} | |
| - name: Set main-branch environment # this is for main-sha tag image build | |
| if: github.ref == 'refs/heads/main' | |
| run: | | |
| commit_sha=${{ github.sha }} | |
| tag=main-${commit_sha:0:7} | |
| echo "VERSION=${tag}" >> $GITHUB_ENV | |
| - name: Set tag environment # this is for v* tag image build | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| run: | | |
| echo "VERSION=${{ github.ref_name }}" >> $GITHUB_ENV | |
| - name: Build and push Docker image | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: ./jobs/async-upload | |
| push: true | |
| tags: ${{ env.IMG_REGISTRY }}/${{ env.IMG_ORG }}/${{ env.IMG_NAME }}:${{ env.VERSION }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max |