From 47f0fa43b6f822c7ce24d2ff0618205db2f559eb Mon Sep 17 00:00:00 2001 From: cat_or_not <41955154+catornot@users.noreply.github.com> Date: Mon, 1 Jun 2026 19:18:06 -0400 Subject: [PATCH] Cache nix builds on main (#921) * cache nix artifacts to cache server instead of uploading them * Revert "cache nix artifacts to cache server instead of uploading them" This reverts commit d9ffaeda9299b92f766ad82b86e0b5c67adf4aa6. * Revert "Revert "cache nix artifacts to cache server instead of uploading them"" This reverts commit 707b4165353901ca162a0ee7d216827757e3c337. * only run on main the motivation for this is to not completly fill my cache server instantly (which only has 15gb) * push the store path instead of the result path --- .github/workflows/ci.yml | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 56ae5eb6..72e9de55 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -96,17 +96,12 @@ jobs: - name: Build run: nix build - - name: Extract Short Commit Hash - id: extract - shell: bash - run: echo commit=$(git rev-parse --short HEAD) >> $GITHUB_OUTPUT - - - name: Upload Build Artifact - uses: actions/upload-artifact@v4 - with: - name: NorthstarLauncher-NIX-${{ steps.extract.outputs.commit }} - path: | - result/ + - name: Cache this Build + continue-on-error: true + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} + run: | + nix run nixpkgs#attic-client -- login northstar https://attic.catornot.net ${{ secrets.ATTIC_CACHE_TOKEN }} + nix run nixpkgs#attic-client -- push northstar $(nix build --print-out-paths) format-check-cmake-files: runs-on: ubuntu-latest