Skip to content

Commit be3ff48

Browse files
authored
chore(ci): try to optimize disk space when tagging latest (#5695)
Signed-off-by: Ettore Di Giacinto <[email protected]>
1 parent af255cd commit be3ff48

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

.github/workflows/backend_build.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ jobs:
210210
cache-from: type=gha
211211
platforms: ${{ inputs.platforms }}
212212
push: ${{ github.event_name != 'pull_request' }}
213+
load: ${{ github.event_name != 'pull_request' && inputs.latest-image != '' && github.ref_type == 'tag' }}
213214
tags: ${{ steps.meta.outputs.tags }}
214215
labels: ${{ steps.meta.outputs.labels }}
215216

@@ -240,10 +241,8 @@ jobs:
240241
- name: Latest tag
241242
if: github.event_name != 'pull_request' && inputs.latest-image != '' && github.ref_type == 'tag'
242243
run: |
243-
docker pull localai/localai-backends:${{ steps.meta.outputs.version }}
244244
docker tag localai/localai-backends:${{ steps.meta.outputs.version }} localai/localai-backends:${{ inputs.latest-image }}
245245
docker push localai/localai-backends:${{ inputs.latest-image }}
246-
docker pull quay.io/go-skynet/local-ai-backends:${{ steps.meta.outputs.version }}
247246
docker tag quay.io/go-skynet/local-ai-backends:${{ steps.meta.outputs.version }} quay.io/go-skynet/local-ai-backends:${{ inputs.latest-image }}
248247
docker push quay.io/go-skynet/local-ai-backends:${{ inputs.latest-image }}
249248

.github/workflows/image_build.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,7 @@ jobs:
255255
cache-from: type=gha
256256
platforms: ${{ inputs.platforms }}
257257
push: ${{ github.event_name != 'pull_request' }}
258+
load: ${{ github.event_name != 'pull_request' && inputs.latest-image != '' && github.ref_type == 'tag' }}
258259
tags: ${{ steps.meta.outputs.tags }}
259260
labels: ${{ steps.meta.outputs.labels }}
260261
### Start testing image
@@ -298,6 +299,7 @@ jobs:
298299
file: ./Dockerfile.aio
299300
platforms: ${{ inputs.platforms }}
300301
push: ${{ github.event_name != 'pull_request' }}
302+
load: ${{ github.event_name != 'pull_request' && inputs.latest-image-aio != '' && github.ref_type == 'tag' }}
301303
tags: ${{ steps.meta_aio.outputs.tags }}
302304
labels: ${{ steps.meta_aio.outputs.labels }}
303305

@@ -313,6 +315,7 @@ jobs:
313315
file: ./Dockerfile.aio
314316
platforms: ${{ inputs.platforms }}
315317
push: ${{ github.event_name != 'pull_request' }}
318+
load: ${{ github.event_name != 'pull_request' && inputs.latest-image-aio != '' && github.ref_type == 'tag' }}
316319
tags: ${{ steps.meta_aio_dockerhub.outputs.tags }}
317320
labels: ${{ steps.meta_aio_dockerhub.outputs.labels }}
318321

@@ -325,20 +328,16 @@ jobs:
325328
# run this on branches, when it is a tag and there is a latest-image defined
326329
if: github.event_name != 'pull_request' && inputs.latest-image != '' && github.ref_type == 'tag'
327330
run: |
328-
docker pull localai/localai:${{ steps.meta.outputs.version }}
329331
docker tag localai/localai:${{ steps.meta.outputs.version }} localai/localai:${{ inputs.latest-image }}
330332
docker push localai/localai:${{ inputs.latest-image }}
331-
docker pull quay.io/go-skynet/local-ai:${{ steps.meta.outputs.version }}
332333
docker tag quay.io/go-skynet/local-ai:${{ steps.meta.outputs.version }} quay.io/go-skynet/local-ai:${{ inputs.latest-image }}
333334
docker push quay.io/go-skynet/local-ai:${{ inputs.latest-image }}
334335
- name: Latest AIO tag
335336
# run this on branches, when it is a tag and there is a latest-image defined
336337
if: github.event_name != 'pull_request' && inputs.latest-image-aio != '' && github.ref_type == 'tag'
337338
run: |
338-
docker pull localai/localai:${{ steps.meta_aio_dockerhub.outputs.version }}
339339
docker tag localai/localai:${{ steps.meta_aio_dockerhub.outputs.version }} localai/localai:${{ inputs.latest-image-aio }}
340340
docker push localai/localai:${{ inputs.latest-image-aio }}
341-
docker pull quay.io/go-skynet/local-ai:${{ steps.meta_aio.outputs.version }}
342341
docker tag quay.io/go-skynet/local-ai:${{ steps.meta_aio.outputs.version }} quay.io/go-skynet/local-ai:${{ inputs.latest-image-aio }}
343342
docker push quay.io/go-skynet/local-ai:${{ inputs.latest-image-aio }}
344343

0 commit comments

Comments
 (0)