From f49698ecc63fccc6b794f1790f5e25fdb97c89cb Mon Sep 17 00:00:00 2001 From: Yehudit Kerido Date: Mon, 29 Sep 2025 11:30:00 +0300 Subject: [PATCH] feat: Migrate kubeflow/kubeflow jwa_docker_publish.yaml GitHub Action to kubeflow/notebooks - notebooks-v1 branch Signed-off-by: Yehudit Kerido --- .github/workflows/jwa_docker_publish.yaml | 90 +++++++++++++++++++++++ components/crud-web-apps/jupyter/Makefile | 2 +- releasing/version/VERSION | 1 + 3 files changed, 92 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/jwa_docker_publish.yaml create mode 100644 releasing/version/VERSION diff --git a/.github/workflows/jwa_docker_publish.yaml b/.github/workflows/jwa_docker_publish.yaml new file mode 100644 index 000000000..c3ba95968 --- /dev/null +++ b/.github/workflows/jwa_docker_publish.yaml @@ -0,0 +1,90 @@ +name: Build & Publish JWA Docker image +on: + push: + branches: + - main + - v*-branch + - notebooks-v1 + paths: + - components/crud-web-apps/jupyter/** + - components/crud-web-apps/common/** + - releasing/version/VERSION + +env: + IMG: ghcr.io/kubeflow/notebooks/jupyter-web-app + PLATFORMS: linux/amd64,linux/ppc64le,linux/arm64 + +jobs: + push_to_registry: + name: Build & Push image to GHCR Hub + runs-on: ubuntu-22.04 + steps: + - name: Checkout + uses: actions/checkout@v4 + + - uses: dorny/paths-filter@v3 + id: filter + with: + base: ${{ github.ref }} + filters: | + version: + - 'releasing/version/VERSION' + + - name: Login to GHCR + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Setup QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: amd64,ppc64le,arm64 + + - name: Setup Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Build and push multi-arch docker image + uses: docker/build-push-action@v5 + with: + context: components/crud-web-apps/ + file: components/crud-web-apps/jupyter/Dockerfile + platforms: ${{ env.PLATFORMS }} + push: true + tags: | + ${{ env.IMG }}:${{ github.sha }} + cache-from: type=gha + cache-to: type=gha,mode=max + + - name: Build and push latest multi-arch docker image + if: github.ref == 'refs/heads/main' + uses: docker/build-push-action@v5 + with: + context: components/crud-web-apps/ + file: components/crud-web-apps/jupyter/Dockerfile + platforms: ${{ env.PLATFORMS }} + push: true + tags: | + ${{ env.IMG }}:latest + cache-from: type=gha + cache-to: type=gha,mode=max + + - name: Get version tag + id: version-tag + if: steps.filter.outputs.version == 'true' + run: echo "version=$(cat releasing/version/VERSION)" >> $GITHUB_OUTPUT + + - name: Build and push multi-arch docker image on Version change + id: version-build + if: steps.filter.outputs.version == 'true' + uses: docker/build-push-action@v5 + with: + context: components/crud-web-apps/ + file: components/crud-web-apps/jupyter/Dockerfile + platforms: ${{ env.PLATFORMS }} + push: true + tags: | + ${{ env.IMG }}:${{ steps.version-tag.outputs.version }} + cache-from: type=gha + cache-to: type=gha,mode=max \ No newline at end of file diff --git a/components/crud-web-apps/jupyter/Makefile b/components/crud-web-apps/jupyter/Makefile index b8dbe53dd..3edb63828 100644 --- a/components/crud-web-apps/jupyter/Makefile +++ b/components/crud-web-apps/jupyter/Makefile @@ -1,4 +1,4 @@ -IMG ?= ghcr.io/kubeflow/kubeflow/jupyter-web-app +IMG ?= ghcr.io/kubeflow/notebooks/jupyter-web-app TAG ?= $(shell git describe --tags --always --dirty) DOCKERFILE ?= jupyter/Dockerfile ARCH ?= linux/amd64 diff --git a/releasing/version/VERSION b/releasing/version/VERSION new file mode 100644 index 000000000..a0f9a4b4b --- /dev/null +++ b/releasing/version/VERSION @@ -0,0 +1 @@ +latest