From 21b3f6dbaeb09116d1d9782cdb07b77dca1bbf4c Mon Sep 17 00:00:00 2001 From: Deepak Mallubhotla Date: Wed, 17 Sep 2025 18:19:29 -0500 Subject: [PATCH] try better caching at least --- .gitea/workflows/deploy.yaml | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml index cd6143f..44165a8 100644 --- a/.gitea/workflows/deploy.yaml +++ b/.gitea/workflows/deploy.yaml @@ -18,13 +18,25 @@ jobs: with: fetch-depth: 0 # Fetch all history for tags - name: Install Nix - uses: cachix/install-nix-action@v31 + uses: cachix/install-nix-action@7be5dee1421f63d07e71ce6e0a9f8a4b07c2a487 + - name: "Cache Nix store" + uses: actions/cache@v4 + id: nix-cache + with: + path: /tmp/nixcache + key: nix-${{ runner.os }}-nix-builder-image-${{ hashFiles('**/package.json', 'package-lock.json', '**/*.nix', '**/flake.lock') }} + restore-keys: | + nix-${{ runner.os }}-nix-builder-image - name: Setup Attic Cache uses: ryanccn/attic-action@3354ae812cb672e1381be4c7914204c44db53866 with: endpoint: ${{ secrets.ATTIC_ENDPOINT }} cache: ${{ secrets.ATTIC_CACHE }} token: ${{ secrets.ATTIC_TOKEN }} + - name: "Import Nix store cache" + continue-on-error: true + # if: "steps.nix-cache.outputs.cache-hit == 'true'" + run: bash scripts/restore_cache.sh - name: Build container run: nix build .#act-runner-image - name: Check Nix flake @@ -55,6 +67,10 @@ jobs: BRANCH: ${{ steps.vars.outputs.BRANCH }} run: | nix develop -c bash scripts/deploy.sh + - name: "Export Nix store cache" + if: always() + # if: "steps.nix-cache.outputs.cache-hit != 'true'" + run: bash scripts/populate_cache.sh nix-check: runs-on: nix-runner steps: @@ -67,7 +83,7 @@ jobs: id: nix-cache with: path: /tmp/nixcache - key: nix-${{ runner.os }}-nix-builder-image-${{ hashFiles('**/package.json', 'package-lock.json', '**/*.nix', '**/flake.lock', '.npmrc', '.eleventy.js') }} + key: nix-${{ runner.os }}-nix-builder-image-${{ hashFiles('**/package.json', 'package-lock.json', '**/*.nix', '**/flake.lock') }} restore-keys: | nix-${{ runner.os }}-nix-builder-image - name: Setup Attic Cache