workflow: always() cache
This commit is contained in:
parent
54af66d26c
commit
d50d2dcb73
2 changed files with 14 additions and 5 deletions
16
.github/workflows/build-machines-and-homes.yml
vendored
16
.github/workflows/build-machines-and-homes.yml
vendored
|
@ -63,13 +63,17 @@ jobs:
|
|||
run: |
|
||||
nix profile install github:zhaofengli/attic
|
||||
attic login cy7 https://cache.cy7.sh "$ATTIC_TOKEN"
|
||||
- name: build and cache
|
||||
- name: build
|
||||
run: |
|
||||
package=".#nixosConfigurations."${{ matrix.machine }}".config.system.build.toplevel"
|
||||
nix build -L "$package"
|
||||
- name: cache
|
||||
if: always()
|
||||
run: |
|
||||
package=".#nixosConfigurations."${{ matrix.machine }}".config.system.build.toplevel"
|
||||
derivation="$(nix path-info --derivation "$package")"
|
||||
cache="$(nix-store --query --requisites --include-outputs "$derivation")"
|
||||
attic push main --stdin <<< "$cache"
|
||||
xargs attic push main <<< "$cache"
|
||||
build-homes:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
|
@ -119,10 +123,14 @@ jobs:
|
|||
run: |
|
||||
nix profile install github:zhaofengli/attic
|
||||
attic login cy7 https://cache.cy7.sh "$ATTIC_TOKEN"
|
||||
- name: build and cache
|
||||
- name: build
|
||||
run: |
|
||||
package=".#homeConfigurations."${{ matrix.home }}".activationPackage"
|
||||
nix build -L "$package"
|
||||
- name: cache
|
||||
if: always()
|
||||
run: |
|
||||
package=".#homeConfigurations."${{ matrix.home }}".activationPackage"
|
||||
derivation="$(nix path-info --derivation "$package")"
|
||||
cache="$(nix-store --query --requisites --include-outputs "$derivation")"
|
||||
attic push main --stdin <<< "$cache"
|
||||
xargs attic push main <<< "$cache"
|
||||
|
|
3
.github/workflows/build-packages.yml
vendored
3
.github/workflows/build-packages.yml
vendored
|
@ -42,10 +42,11 @@ jobs:
|
|||
attic login cy7 https://cache.cy7.sh "$ATTIC_TOKEN"
|
||||
- run: nix build -L ${{ matrix.package }}
|
||||
- name: cache result
|
||||
if: always()
|
||||
run: |
|
||||
derivation="$(nix path-info --derivation "${{ matrix.package }}")"
|
||||
cache="$(nix-store --query --requisites --include-outputs "$derivation")"
|
||||
attic push main --stdin <<< "$cache"
|
||||
xargs attic push main <<< "$cache"
|
||||
- name: prepare tarball to upload
|
||||
run: nix run github:nixos/nixpkgs#gnutar hcvf result.tar result
|
||||
- name: upload result
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue