Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions .github/workflows/ws-backend-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Build & Publish Backend container image
on:
push:
branches:
- main
- notebooks-v2
- v*-branch
paths:
- workspaces/** ## NOTE: we publish changes on any commit to workspaces/ components
- releasing/version/VERSION

env:
REGISTRY: ghcr.io/kubeflow/notebooks
NAME: workspaces-backend

jobs:
push_to_registry:
name: Build & Push container image to GHCR
runs-on: ubuntu-latest
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

- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build and push multi-arch container image
run: |
cd workspaces/backend
make docker-buildx REGISTRY=${REGISTRY} NAME=${NAME}

- name: Build and push multi-arch container image on Version change
if: steps.filter.outputs.version == 'true'
run: |
VERSION=$(cat releasing/version/VERSION)
cd workspaces/backend
make docker-buildx REGISTRY=${REGISTRY} NAME=${NAME} TAG=${VERSION}
8 changes: 7 additions & 1 deletion workspaces/backend/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
GIT_COMMIT := $(shell git rev-parse HEAD)
GIT_TREE_STATE := $(shell test -n "`git status --porcelain`" && echo "-dirty" || echo "")

# Image URL to use all building/pushing image targets
IMG ?= nb-backend:latest
REGISTRY ?= ghcr.io/kubeflow/notebooks
NAME ?= workspaces-backend
TAG ?= sha-$(GIT_COMMIT)$(GIT_TREE_STATE)
IMG ?= $(REGISTRY)/$(NAME):$(TAG)
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
ENVTEST_K8S_VERSION = 1.31.0

Expand Down