From 6c99b196e88b846694273eeb79c017ee1ba80ae4 Mon Sep 17 00:00:00 2001 From: Sergey Shorokhov Date: Sun, 31 Mar 2024 22:59:43 +0300 Subject: [PATCH] Add Cache Docker layers --- .github/workflows/CI.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 29b15fb..0bcd7e0 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -34,6 +34,14 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3.2.0 + - name: Cache Docker layers + uses: actions/cache@v4.0.2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + - name: Log in to Docker Hub if: github.ref == 'refs/heads/master' uses: docker/login-action@v3.1.0 @@ -50,4 +58,6 @@ jobs: platforms: ${{ env.DOCKER_PLATFORMS }} push: true tags: ${{ env.DOCKER_IMAGE }}:${{ matrix.branch }} - build-args: ${{ matrix.build-args }} \ No newline at end of file + build-args: ${{ matrix.build-args }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache \ No newline at end of file