Skip to content

Commit 0636c9a

Browse files
committed
feat: Migrate pvcviewer controller publish action
Signed-off-by: noa limoy <[email protected]>
1 parent 5f191bc commit 0636c9a

File tree

2 files changed

+84
-1
lines changed

2 files changed

+84
-1
lines changed
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
name: Build & Publish PVCViewer Controller Docker image
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- v*-branch
8+
- feature/migrate_pvcviewer_controller_docker_publish_to_notebooks
9+
paths:
10+
- components/pvcviewer-controller/**
11+
- components/common/**
12+
- releasing/version/VERSION
13+
14+
env:
15+
#IMG: ghcr.io/kubeflow/notebooks/pvcviewer-controller
16+
IMG: ghcr.io/Noa-limoy/notebooks/pvcviewer-controller
17+
ARCH: linux/amd64,linux/ppc64le,linux/arm64/v8
18+
19+
jobs:
20+
push_to_registry:
21+
name: Build & Push image to GHCR
22+
runs-on: ubuntu-22.04
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@v4
26+
27+
- uses: dorny/paths-filter@v3
28+
id: filter
29+
with:
30+
base: ${{ github.ref }}
31+
filters: |
32+
version:
33+
- 'releasing/version/VERSION'
34+
35+
# 🔹 Added for testing compatibility with DockerHub and GHCR
36+
- name: Set registry and credentials # Added for testing
37+
id: registry
38+
run: |
39+
if [[ "${GITHUB_REPOSITORY}" == "kubeflow/notebooks" ]]; then
40+
echo "registry=ghcr.io" >> $GITHUB_OUTPUT
41+
echo "username=${{ github.actor }}" >> $GITHUB_OUTPUT
42+
echo "password=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_OUTPUT
43+
echo "image=ghcr.io/kubeflow/notebooks/pvcviewer-controller" >> $GITHUB_OUTPUT
44+
else
45+
echo "registry=ghcr.io" >> $GITHUB_OUTPUT
46+
echo "username=${{ secrets.FORK_REGISTRY_USERNAME }}" >> $GITHUB_OUTPUT
47+
echo "password=${{ secrets.FORK_REGISTRY_PASSWORD }}" >> $GITHUB_OUTPUT
48+
echo "image=${{ format('ghcr.io/{0}/pvcviewer-controller', secrets.FORK_REGISTRY_USERNAME) }}" >> $GITHUB_OUTPUT
49+
fi
50+
51+
# 🔹 GHCR login (works if using GitHub Packages)
52+
- name: Login to registry
53+
uses: docker/login-action@v3
54+
with:
55+
registry: ${{ steps.registry.outputs.registry }}
56+
username: ${{ steps.registry.outputs.username }}
57+
password: ${{ steps.registry.outputs.password }}
58+
59+
- name: Setup Docker Buildx
60+
uses: docker/setup-buildx-action@v3
61+
62+
- name: Build and push multi-arch docker image
63+
run: |
64+
cd components/pvcviewer-controller
65+
ARCH=linux/amd64 make docker-build-multi-arch
66+
ARCH=linux/ppc64le make docker-build-multi-arch
67+
ARCH=linux/arm64/v8 make docker-build-multi-arch
68+
make docker-build-push-multi-arch
69+
70+
- name: Build and push latest multi-arch docker image
71+
if: github.ref == 'refs/heads/main'
72+
run: |
73+
export TAG=latest
74+
cd components/pvcviewer-controller
75+
make docker-build-push-multi-arch
76+
77+
- name: Build and push multi-arch docker image on Version change
78+
id: version
79+
if: steps.filter.outputs.version == 'true'
80+
run: |
81+
export TAG=$(cat releasing/version/VERSION)
82+
cd components/pvcviewer-controller
83+
make docker-build-push-multi-arch

components/pvcviewer-controller/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Image URL to use all building/pushing image targets
2-
IMG ?= ghcr.io/kubeflow/kubeflow/pvcviewer-controller
2+
IMG ?= ghcr.io/kubeflow/notebooks/pvcviewer-controller
33
TAG ?= $(shell git describe --tags --always --dirty)
44
ARCH ?= linux/amd64
55

0 commit comments

Comments
 (0)