workflow: use attic cache for packages too

This commit is contained in:
cy 2025-03-13 14:30:02 -04:00
parent 7a971e519a
commit 8209ff70ff
Signed by: cy
SSH key fingerprint: SHA256:o/geVWV4om1QhUSkKvDQeW/eAihwnjyXkqMwrVdbuts
2 changed files with 26 additions and 7 deletions

View file

@ -70,6 +70,9 @@ jobs:
- run: |
nix build -L .#nixosConfigurations.${{ matrix.machine }}.config.system.build.toplevel
- name: cache result
run: |
nix run github:zhaofengli/attic push main result
build-homes:
@ -126,4 +129,7 @@ jobs:
- run: |
nix build -L .#homeConfigurations."${{ matrix.home }}".activationPackage
- name: cache result
run: |
nix run github:zhaofengli/attic push main result

View file

@ -6,6 +6,17 @@ on:
description: "package to build"
required: false
type: string
env:
ATTIC_TOKEN: ${{ secrets.ATTIC_TOKEN }}
NIX_CONFIG: |
show-trace = true
extra-substituters = https://cache.cy7.sh/main
extra-trusted-public-keys = main:Ku31HoEWcBtfggge2VGj+QTkVrQuIwRIMGyfV/5VQP0=
experimental-features = nix-command flakes
extra-experimental-features = nix-command flakes
accept-flake-config = true
TERM: ansi
jobs:
build-packages:
strategy:
@ -18,6 +29,7 @@ jobs:
- ubuntu-24.04-arm
- macos-latest
- macos-13
runs-on: ${{ matrix.os }}
steps:
- name: Install Nix
@ -27,12 +39,13 @@ jobs:
uses: actions/checkout@v4
with:
persist-credentials: false
- uses: cachix/cachix-action@v14
with:
name: cything
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
useDaemon: false
installCommand: nix profile install nixpkgs#cachix
- name: setup attic
run: |
nix run github:zhaofengli/attic login cy7 https://cache.cy7.sh "$ATTIC_TOKEN"
- run: nix build -L ${{ matrix.package }}
- name: cache result
run: |
nix run github:zhaofengli/attic push main result