1+ name : Build and Push UI Standalone Image
2+ # this workflow builds an image to support local testing
3+ on :
4+ push :
5+ branches :
6+ - ' main'
7+ tags :
8+ - ' v*'
9+ paths :
10+ - ' clients/ui/**'
11+ - ' !LICENSE*'
12+ - ' !DOCKERFILE*'
13+ - ' !**.gitignore'
14+ - ' !**.md'
15+ - ' !**.txt'
16+ env :
17+ IMG_REGISTRY : ghcr.io
18+ IMG_ORG : kubeflow
19+ IMG_UI_REPO : model-registry/ui-standalone # this image is intended for local development, not production
20+ DOCKER_USER : ${{ github.actor }}
21+ DOCKER_PWD : ${{ secrets.GITHUB_TOKEN }}
22+ jobs :
23+ build-and-push :
24+ runs-on : ubuntu-latest
25+ permissions :
26+ contents : read
27+ packages : write
28+ steps :
29+ - name : Checkout repository
30+ uses : actions/checkout@v5
31+
32+ - name : Set up Docker Buildx
33+ uses : docker/setup-buildx-action@v3
34+
35+ - name : Log in to the Container registry
36+ uses : docker/login-action@v3
37+ with :
38+ registry : ${{ env.IMG_REGISTRY }}
39+ username : ${{ env.DOCKER_USER }}
40+ password : ${{ env.DOCKER_PWD }}
41+
42+ - name : Set main-branch environment
43+ if : github.ref == 'refs/heads/main'
44+ run : |
45+ commit_sha=${{ github.sha }}
46+ tag=main-${commit_sha:0:7}
47+ echo "VERSION=${tag}" >> $GITHUB_ENV
48+
49+ - name : Set tag environment
50+ if : startsWith(github.ref, 'refs/tags/v')
51+ run : |
52+ echo "VERSION=${{ github.ref_name }}" >> $GITHUB_ENV
53+
54+ - name : Extract metadata (tags, labels) for Docker
55+ id : meta
56+ uses : docker/metadata-action@v5
57+ with :
58+ images : " ${{ env.IMG_REGISTRY }}/${{ env.IMG_ORG }}/${{ env.IMG_UI_REPO }}"
59+ tags : |
60+ type=ref,event=branch
61+ type=ref,event=pr
62+ type=semver,pattern={{version}}
63+ type=semver,pattern={{major}}.{{minor}}
64+ type=sha
65+ type=raw,value=${{ env.VERSION }},enable=${{ env.VERSION != '' }}
66+ type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
67+
68+ - name : Build and push Docker image
69+ uses : docker/build-push-action@v6
70+ with :
71+ context : ./clients/ui
72+ push : true
73+ tags : ${{ steps.meta.outputs.tags }}
74+ labels : ${{ steps.meta.outputs.labels }}
75+ build-args : |
76+ DEPLOYMENT_MODE=standalone
77+ STYLE_THEME=mui-theme
78+ cache-from : type=gha
79+ cache-to : type=gha,mode=max
0 commit comments