Added caching restore and save action
All checks were successful
Nix Web Proxy Worker / setup-nixos-runner (push) Successful in 15m4s
All checks were successful
Nix Web Proxy Worker / setup-nixos-runner (push) Successful in 15m4s
This commit is contained in:
@@ -4,17 +4,30 @@ on: [push, merge]
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
setup-nixos-runner:
|
setup-nixos-runner:
|
||||||
run-on: ubuntu-latest
|
run-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- uses: webfactory/ssh-agent@v0.9.0
|
- uses: webfactory/ssh-agent@v0.9.0
|
||||||
with:
|
with:
|
||||||
ssh-private-key: ${{ secrets.WEB_PROXY_SSH_PRIVATE_KEY }}
|
ssh-private-key: ${{ secrets.WEB_PROXY_SSH_PRIVATE_KEY }}
|
||||||
- uses: cachix/install-nix-action@v31
|
- uses: cachix/install-nix-action@v31
|
||||||
- uses: actions/cache@v4
|
|
||||||
with:
|
|
||||||
path: /nix/store
|
|
||||||
- name: Ensure known host name
|
- name: Ensure known host name
|
||||||
run: ssh-keyscan ${{ vars.WEB_PROXY_IP }} >> ~/.ssh/known_hosts
|
run: ssh-keyscan ${{ vars.WEB_PROXY_IP }} >> ~/.ssh/known_hosts
|
||||||
|
|
||||||
|
- name: Restore Cache Nix Store
|
||||||
|
id: nix-cache-restore
|
||||||
|
uses: actions/cache/restore@v4
|
||||||
|
with:
|
||||||
|
path: /nix/store
|
||||||
|
key: ${{ runner.os }}-web-proxy-nix-store
|
||||||
|
|
||||||
- name: Apply Nix build to Web Proxy host
|
- name: Apply Nix build to Web Proxy host
|
||||||
run: nix-shell shell.nix --run "nixos-rebuild switch --no-flake --target-host ${{ vars.WEB_PROXY_TARGET_HOST }}"
|
run: nix-shell shell.nix --run "nixos-rebuild switch --no-flake --target-host ${{ vars.WEB_PROXY_TARGET_HOST }}"
|
||||||
|
|
||||||
|
- name: Save Cache Nix Store
|
||||||
|
uses: actions/cache/save@v4
|
||||||
|
with:
|
||||||
|
path: /nix/store
|
||||||
|
key: ${{ steps.nix-cache-restore.outputs.cache-primary-key }}
|
||||||
Reference in New Issue
Block a user