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
56 changes: 56 additions & 0 deletions .github/workflows/ws-frontend-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Build & Publish Frontend container image
on:
push:
branches:
- main
- notebooks-v2
- v*-branch
paths:
- workspaces/** ## NOTE: we publish changes on any commit to workspaces/frontend components
- releasing/version/VERSION

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

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/frontend
make docker-buildx REGISTRY=${REGISTRY} NAME=${NAME}

- name: Build and push multi-arch container image on Version change
id: version
if: steps.filter.outputs.version == 'true'
run: |
VERSION=$(cat releasing/version/VERSION)
cd workspaces/frontend
make docker-buildx REGISTRY=${REGISTRY} NAME=${NAME} TAG=${VERSION}
8 changes: 7 additions & 1 deletion workspaces/frontend/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 for building/pushing the frontend image
IMG ?= nbv2-frontend:latest
REGISTRY ?= ghcr.io/kubeflow/notebooks
NAME ?= workspaces-frontend
TAG ?= sha-$(GIT_COMMIT)$(GIT_TREE_STATE)
IMG ?= $(REGISTRY)/$(NAME):$(TAG)

# CONTAINER_TOOL defines the container tool to be used for building images.
# Tested with Docker by default. You may replace with podman.
Expand Down