From a993ae099b46cf5b40cf3ed43b627b0e9956fd60 Mon Sep 17 00:00:00 2001 From: uy/sun Date: Sat, 28 Dec 2024 22:43:35 +0800 Subject: [PATCH] =?UTF-8?q?ci:=20=E6=B7=BB=E5=8A=A0=20buildkit=20=E7=BC=93?= =?UTF-8?q?=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/main.yml | 42 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5cfae90e..0d966fd9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -63,6 +63,27 @@ jobs: type=semver,pattern={{version}} type=ref,event=branch + - name: Cache buildkit + uses: actions/cache@v4 + id: cache + with: + path: | + var-cache-apt + var-lib-apt + root-cache-uv + key: cache-${{ hashFiles('.github/workflows/test/Dockerfile') }} + + - name: Inject cache into docker + uses: reproducible-containers/buildkit-cache-dance@v3.1.2 + with: + cache-map: | + { + "var-cache-apt": "/var/cache/apt", + "var-lib-apt": "/var/lib/apt", + "root-cache-uv": "/root/.cache/uv" + } + skip-extraction: ${{ steps.cache.outputs.cache-hit }} + - name: Build and Publish uses: docker/build-push-action@v6 with: @@ -102,6 +123,27 @@ jobs: type=semver,pattern={{version}} type=ref,event=branch + - name: Cache buildkit + uses: actions/cache@v4 + id: cache + with: + path: | + var-cache-apt + var-lib-apt + root-cache-uv + key: cache-${{ hashFiles('.github/workflows/test/Dockerfile') }} + + - name: Inject cache into docker + uses: reproducible-containers/buildkit-cache-dance@v3.1.2 + with: + cache-map: | + { + "var-cache-apt": "/var/cache/apt", + "var-lib-apt": "/var/lib/apt", + "root-cache-uv": "/root/.cache/uv" + } + skip-extraction: ${{ steps.cache.outputs.cache-hit }} + - name: Build and Publish uses: docker/build-push-action@v6 with: