workflow: try yet another way to cache
This commit is contained in:
parent
47e5c5cd77
commit
1537fd6444
2 changed files with 32 additions and 11 deletions
30
.github/workflows/build-machines-and-homes.yml
vendored
30
.github/workflows/build-machines-and-homes.yml
vendored
|
@ -70,12 +70,19 @@ jobs:
|
||||||
nix build -L "$package"
|
nix build -L "$package"
|
||||||
|
|
||||||
- name: cache
|
- name: cache
|
||||||
if: always()
|
# if: always()
|
||||||
run: |
|
run: |
|
||||||
package=".#nixosConfigurations."${{ matrix.machine }}".config.system.build.toplevel"
|
package=".#nixosConfigurations."${{ matrix.machine }}".config.system.build.toplevel"
|
||||||
nix copy -j8 \
|
derivations=()
|
||||||
--to 's3://nixcache?endpoint=s3.cy7.sh&secret-key=/home/runner/cache-priv-key.pem' \
|
while IFS=$'\n' read derivation; do
|
||||||
$(nix path-info --recursive --derivation "$package" |sed 's/\.drv$/.drv^*/')
|
derivations+=("$derivation")
|
||||||
|
done < <(nix path-info --derivation "$package")
|
||||||
|
|
||||||
|
for derivation in "${derivations[@]}"; do
|
||||||
|
nix copy -j8 \
|
||||||
|
--to 's3://nixcache?endpoint=s3.cy7.sh&secret-key=/home/runner/cache-priv-key.pem' \
|
||||||
|
$(nix-store --query --requisites --include-outputs "$derivation")
|
||||||
|
done
|
||||||
|
|
||||||
build-homes:
|
build-homes:
|
||||||
strategy:
|
strategy:
|
||||||
|
@ -129,9 +136,16 @@ jobs:
|
||||||
nix build -L "$package"
|
nix build -L "$package"
|
||||||
|
|
||||||
- name: cache
|
- name: cache
|
||||||
if: always()
|
# if: always()
|
||||||
run: |
|
run: |
|
||||||
package=".#homeConfigurations."${{ matrix.home }}".activationPackage"
|
package=".#homeConfigurations."${{ matrix.home }}".activationPackage"
|
||||||
nix copy -j8 \
|
derivations=()
|
||||||
--to 's3://nixcache?endpoint=s3.cy7.sh&secret-key=/home/runner/cache-priv-key.pem' \
|
while IFS=$'\n' read derivation; do
|
||||||
$(nix path-info --recursive --derivation "$package" |sed 's/\.drv$/.drv^*/')
|
derivations+=("$derivation")
|
||||||
|
done < <(nix path-info --derivation "$package")
|
||||||
|
|
||||||
|
for derivation in "${derivations[@]}"; do
|
||||||
|
nix copy -j8 \
|
||||||
|
--to 's3://nixcache?endpoint=s3.cy7.sh&secret-key=/home/runner/cache-priv-key.pem' \
|
||||||
|
$(nix-store --query --requisites --include-outputs "$derivation")
|
||||||
|
done
|
||||||
|
|
13
.github/workflows/build-packages.yml
vendored
13
.github/workflows/build-packages.yml
vendored
|
@ -61,9 +61,16 @@ jobs:
|
||||||
- name: cache result
|
- name: cache result
|
||||||
if: always()
|
if: always()
|
||||||
run: |
|
run: |
|
||||||
nix copy -j8 \
|
derivations=()
|
||||||
--to 's3://nixcache?endpoint=s3.cy7.sh&secret-key=/home/runner/cache-priv-key.pem' \
|
while IFS=$'\n' read derivation; do
|
||||||
$(nix path-info --recursive --derivation "${{ matrix.package }}" |sed 's/\.drv$/.drv^*/')
|
derivations+=("$derivation")
|
||||||
|
done < <(nix path-info --derivation "${{ matrix.package }}")
|
||||||
|
|
||||||
|
for derivation in "${derivations[@]}"; do
|
||||||
|
nix copy -j8 \
|
||||||
|
--to 's3://nixcache?endpoint=s3.cy7.sh&secret-key=/home/runner/cache-priv-key.pem' \
|
||||||
|
$(nix-store --query --requisites --include-outputs "$derivation")
|
||||||
|
done
|
||||||
|
|
||||||
- name: prepare tarball to upload
|
- name: prepare tarball to upload
|
||||||
run: nix run github:nixos/nixpkgs#gnutar hcvf result.tar result
|
run: nix run github:nixos/nixpkgs#gnutar hcvf result.tar result
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue