From 5794f784ad448263b99d3f1abaf30c7658038bf8 Mon Sep 17 00:00:00 2001 From: Alexey Pustovalov Date: Sun, 18 Feb 2024 02:06:32 +0900 Subject: [PATCH] Updated building images workflow --- .github/workflows/images_build.yml | 31 ++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/.github/workflows/images_build.yml b/.github/workflows/images_build.yml index 36b7ec56d..92146e77a 100644 --- a/.github/workflows/images_build.yml +++ b/.github/workflows/images_build.yml @@ -342,6 +342,7 @@ jobs: cache_from=$(printf '%s\n' "${cache_from[@]}") cache_to=$(printf '%s\n' "${cache_to[@]}") + mkdir -p /tmp/.buildx-base-cache echo 'cache_from<> "$GITHUB_OUTPUT" echo "$cache_from" >> "$GITHUB_OUTPUT" @@ -350,6 +351,12 @@ jobs: echo "$cache_to" >> "$GITHUB_OUTPUT" echo 'EOF' >> "$GITHUB_OUTPUT" + - name: Download metadata of ${{ env.BASE_BUILD_NAME }}:${{ matrix.os }} + uses: actions/cache/restore@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0 + with: + path: /tmp/.buildx-base-cache + key: ${{ env.BASE_BUILD_NAME }}-${{ matrix.os }}-${{ github.run_id }} + - name: Build and publish image id: docker_build uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56 # v5.1.0 @@ -565,6 +572,18 @@ jobs: "$BASE_IMAGE" echo "::endgroup::" + - name: Download metadata of ${{ env.BASE_BUILD_NAME }}:${{ matrix.os }} + uses: actions/cache/restore@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0 + with: + path: /tmp/.buildx-base-cache + key: ${{ env.BASE_BUILD_NAME }}-${{ matrix.os }}-${{ github.run_id }} + + - name: Download metadata of ${{ matrix.build }}:${{ matrix.os }} + uses: actions/cache/restore@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0 + with: + path: /tmp/.buildx-build-cache + key: ${{ matrix.build }}-${{ matrix.os }}-${{ github.run_id }} + - name: Prepare cache data id: cache_data env: @@ -600,18 +619,6 @@ jobs: echo "$cache_to" >> "$GITHUB_OUTPUT" echo 'EOF' >> "$GITHUB_OUTPUT" - - name: Download metadata of ${{ env.BASE_BUILD_NAME }}:${{ matrix.os }} - uses: actions/cache/restore@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0 - with: - path: /tmp/.buildx-base-cache - key: ${{ env.BASE_BUILD_NAME }}-${{ matrix.os }}-${{ github.run_id }} - - - name: Download metadata of ${{ matrix.build }}:${{ matrix.os }} - uses: actions/cache/restore@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0 - with: - path: /tmp/.buildx-build-cache - key: ${{ matrix.build }}-${{ matrix.os }}-${{ github.run_id }} - - name: Build ${{ matrix.build }}/${{ matrix.os }} and push id: docker_build uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56 # v5.1.0