From 60cf1c4df73055aa958a67fbcdb72d0f861c89d3 Mon Sep 17 00:00:00 2001 From: Gabriel Simmer Date: Tue, 15 Aug 2023 18:30:00 +0100 Subject: [PATCH] Try manually caching --- .gitea/workflows/build-pi-img.yml | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/build-pi-img.yml b/.gitea/workflows/build-pi-img.yml index 0814bdc..124fd63 100644 --- a/.gitea/workflows/build-pi-img.yml +++ b/.gitea/workflows/build-pi-img.yml @@ -22,9 +22,28 @@ jobs: nix_path: nixpkgs=channel:nixos-23.05 - name: Remove access_tokens run: sed -i '/^access-tokens/d' /etc/nix/nix.conf - - uses: https://github.com/DeterminateSystems/magic-nix-cache-action@main + + - name: Cache Nix store + uses: actions/cache@v3.0.8 + id: nix-cache + with: + path: /tmp/nixcache + key: "pi-build-cache" + + - name: "Import Nix store cache" + if: "steps.nix-cache.outputs.cache-hit == 'true'" + run: "nix-store --import < /tmp/nixcache" + + - name: "Build application" + run: "nix build --print-build-logs" + - name: Build image run: nix-build '' -A config.system.build.sdImage -I nixos-config=./pi-imgs/pi-initial.nix --argstr system aarch64-linux - uses: https://github.com/actions/upload-artifact@v3.1.2 with: path: result/sd-image/*.img + + - name: "Export Nix store cache" + if: "steps.nix-cache.outputs.cache-hit != 'true'" + run: "nix-store --export $(find /nix/store -maxdepth 1 -name '*-*') > /tmp/nixcache" +