Skip to content

Commit bec6a47

Browse files
author
Richard Kuo (Onyx)
committed
ensure we don't tag 'latest' with cloud images
1 parent 1a8b7ab commit bec6a47

4 files changed

+15
-5
lines changed

.github/workflows/docker-build-push-backend-container-on-tag.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@ on:
77

88
env:
99
REGISTRY_IMAGE: ${{ contains(github.ref_name, 'cloud') && 'onyxdotapp/onyx-backend-cloud' || 'onyxdotapp/onyx-backend' }}
10-
LATEST_TAG: ${{ contains(github.ref_name, 'latest') }}
1110
DEPLOYMENT: ${{ contains(github.ref_name, 'cloud') && 'cloud' || 'standalone' }}
11+
12+
# don't tag cloud images with "latest"
13+
LATEST_TAG: ${{ contains(github.ref_name, 'latest') && !contains(github.ref_name, 'cloud') }}
1214

1315
jobs:
1416
build-and-push:
@@ -111,6 +113,9 @@ jobs:
111113
uses: docker/metadata-action@v5
112114
with:
113115
images: ${{ env.REGISTRY_IMAGE }}
116+
tags: |
117+
type=raw,value=${{ env.REGISTRY_IMAGE }}:${{ github.ref_name }}
118+
type=raw,value=${{ env.LATEST_TAG == 'true' && format('{0}:latest', env.REGISTRY_IMAGE) || '' }}
114119
115120
- name: Login to Docker Hub
116121
uses: docker/login-action@v3

.github/workflows/docker-build-push-cloud-web-container-on-tag.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ on:
88

99
env:
1010
REGISTRY_IMAGE: onyxdotapp/onyx-web-server-cloud
11-
LATEST_TAG: ${{ contains(github.ref_name, 'latest') }}
1211
DEPLOYMENT: cloud
1312

1413
jobs:
@@ -41,7 +40,6 @@ jobs:
4140
images: ${{ env.REGISTRY_IMAGE }}
4241
tags: |
4342
type=raw,value=${{ env.REGISTRY_IMAGE }}:${{ github.ref_name }}
44-
type=raw,value=${{ env.LATEST_TAG == 'true' && format('{0}:latest', env.REGISTRY_IMAGE) || '' }}
4543
4644
- name: Set up Docker Buildx
4745
uses: docker/setup-buildx-action@v3
@@ -112,6 +110,8 @@ jobs:
112110
uses: docker/metadata-action@v5
113111
with:
114112
images: ${{ env.REGISTRY_IMAGE }}
113+
tags: |
114+
type=raw,value=${{ env.REGISTRY_IMAGE }}:${{ github.ref_name }}
115115
116116
- name: Login to Docker Hub
117117
uses: docker/login-action@v3

.github/workflows/docker-build-push-model-server-container-on-tag.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@ on:
77

88
env:
99
REGISTRY_IMAGE: ${{ contains(github.ref_name, 'cloud') && 'onyxdotapp/onyx-model-server-cloud' || 'onyxdotapp/onyx-model-server' }}
10-
LATEST_TAG: ${{ contains(github.ref_name, 'latest') }}
1110
DOCKER_BUILDKIT: 1
1211
BUILDKIT_PROGRESS: plain
1312
DEPLOYMENT: ${{ contains(github.ref_name, 'cloud') && 'cloud' || 'standalone' }}
13+
14+
# don't tag cloud images with "latest"
15+
LATEST_TAG: ${{ contains(github.ref_name, 'latest') && !contains(github.ref_name, 'cloud') }}
1416

1517
jobs:
1618

.github/workflows/docker-build-push-web-container-on-tag.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ env:
99
REGISTRY_IMAGE: onyxdotapp/onyx-web-server
1010
LATEST_TAG: ${{ contains(github.ref_name, 'latest') }}
1111
DEPLOYMENT: standalone
12-
12+
1313
jobs:
1414
build:
1515
runs-on:
@@ -104,6 +104,9 @@ jobs:
104104
uses: docker/metadata-action@v5
105105
with:
106106
images: ${{ env.REGISTRY_IMAGE }}
107+
tags: |
108+
type=raw,value=${{ env.REGISTRY_IMAGE }}:${{ github.ref_name }}
109+
type=raw,value=${{ env.LATEST_TAG == 'true' && format('{0}:latest', env.REGISTRY_IMAGE) || '' }}
107110
108111
- name: Login to Docker Hub
109112
uses: docker/login-action@v3

0 commit comments

Comments
 (0)