From affb4e0462807717314985ea21ffcb254c1ca293 Mon Sep 17 00:00:00 2001 From: Asher Foa Date: Fri, 13 Jun 2025 07:15:26 -0400 Subject: [PATCH] Upgrade docker GH actions + use layers caching for faster builds (#2697) --- .github/workflows/build-docker-image.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-docker-image.yml b/.github/workflows/build-docker-image.yml index b67d32d1..1d8e9e0d 100644 --- a/.github/workflows/build-docker-image.yml +++ b/.github/workflows/build-docker-image.yml @@ -34,10 +34,10 @@ jobs: username: ${{ env.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@v3 - name: Build, tag, and push backend image to Amazon Public ECR and Docker Hub id: build-image - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v6 env: ECR_REGISTRY: ${{ steps.login-ecr-public.outputs.registry }} with: @@ -46,6 +46,8 @@ jobs: linux/amd64 linux/arm64 push: true + cache-from: type=gha + cache-to: type=gha,mode=max tags: | ${{ env.ECR_REGISTRY}}/${{ env.REGISTRY_ALIAS }}/${{ env.ECR_BACKEND_REPOSITORY }}:${{ github.sha }} ${{ env.ECR_REGISTRY}}/${{ env.REGISTRY_ALIAS }}/${{ env.ECR_BACKEND_REPOSITORY }}:${{ github.event.release.tag_name }} @@ -55,12 +57,14 @@ jobs: ${{ env.DOCKERHUB_USERNAME }}/${{ env.ECR_BACKEND_REPOSITORY }}:latest - name: Build, tag, and push ui image to Amazon Public ECR and Docker Hub id: build-ui-image - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v6 env: ECR_REGISTRY: ${{ steps.login-ecr-public.outputs.registry }} with: context: . file: Dockerfile.ui + cache-from: type=gha + cache-to: type=gha,mode=max platforms: | linux/amd64 linux/arm64