From 956f74ab95ae3de98d5efd6568bcb546cb4a2d2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Jab=C5=82o=C5=84ski?= Date: Thu, 26 Sep 2024 07:02:21 +0200 Subject: [PATCH] ci: add cache and trigger for pushes, in the Hub docker action (#22314) --- .github/workflows/hub_docker_ci.yml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/hub_docker_ci.yml b/.github/workflows/hub_docker_ci.yml index c18ba579b3..dfb8853650 100644 --- a/.github/workflows/hub_docker_ci.yml +++ b/.github/workflows/hub_docker_ci.yml @@ -2,6 +2,10 @@ name: hub_docker_ci on: workflow_dispatch: + push: + tags: + - '[0-9].[0-9]+.[0-9]+' # trigger on new release tag + - 'weekly.*' # trigger on weekly tag jobs: publish-new-docker-images: @@ -35,17 +39,19 @@ jobs: echo 'TAGS=thevlang/vlang:${{ matrix.os }}' >> $GITHUB_OUTPUT fi - - uses: docker/build-push-action@v4 + - uses: docker/build-push-action@v6 name: Build and deploy v image with: context: . platforms: linux/amd64,linux/arm64 tags: ${{ steps.gen_tags.outputs.TAGS }} file: docker/vlang/Dockerfile.${{ matrix.os }} - push: ${{ github.event_name != 'pull_request' }} + push: true build-args: 'USER=thevlang' + cache-from: type=registry,ref=thevlang/vlang:${{ matrix.os }}-buildcache + cache-to: type=registry,ref=thevlang/vlang:${{ matrix.os }}-buildcache,mode=max - - uses: docker/build-push-action@v4 + - uses: docker/build-push-action@v6 name: Build and deploy developer build with: context: . @@ -53,4 +59,6 @@ jobs: tags: thevlang/vlang:${{ matrix.os }}-dev file: docker/vlang/Dockerfile.${{ matrix.os }}.dev-full build-args: 'USER=thevlang' - push: ${{ github.event_name != 'pull_request' }} + push: true + cache-from: type=registry,ref=thevlang/vlang:${{ matrix.os }}-dev-buildcache + cache-to: type=registry,ref=thevlang/vlang:${{ matrix.os }}-dev-buildcache,mode=max