From d1a6ea078ea33cad6e1ca018fb37974a645a763d Mon Sep 17 00:00:00 2001 From: Jan Kiszka Date: Mon, 26 Feb 2024 12:40:37 +0100 Subject: [PATCH] ci: Enable apt caching for container builds The Dockerfile is already prepared and works locally. Now also make use of that on github. Signed-off-by: Jan Kiszka --- .github/actions/docker-init/action.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/.github/actions/docker-init/action.yml b/.github/actions/docker-init/action.yml index a89c5859..aae2f252 100644 --- a/.github/actions/docker-init/action.yml +++ b/.github/actions/docker-init/action.yml @@ -35,3 +35,27 @@ runs: run: | git clone . /home/runner/kas-clone shell: bash + - name: Cache var-cache-apt + id: cache-var-cache-apt + uses: actions/cache@v4 + with: + path: var-cache-apt + key: var-cache-apt-${{ env.DEBIAN_TAG }} + - name: Cache var-lib-apt + id: cache-var-lib-apt + uses: actions/cache@v4 + with: + path: var-lib-apt + key: var-lib-apt-${{ env.DEBIAN_TAG }} + - name: Inject var-cache-apt into docker + uses: reproducible-containers/buildkit-cache-dance@v2.1.4 + with: + cache-source: var-cache-apt + cache-target: /var/cache/apt + skip-extraction: ${{ steps.cache-var-cache-apt.outputs.cache-hit }} + - name: Inject var-lib-apt into docker + uses: reproducible-containers/buildkit-cache-dance@v2.1.4 + with: + cache-source: var-lib-apt + cache-target: /var/lib/apt + skip-extraction: ${{ steps.cache-var-lib-apt.outputs.cache-hit }}