Skip to content

Commit

Permalink
Work around permission issues with caching action
Browse files Browse the repository at this point in the history
  • Loading branch information
alerque committed Dec 30, 2023
1 parent a33f191 commit 5741164
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,19 @@ jobs:
uses: actions/checkout@v4

- name: Cache Nix downloads
id: nix-store-cache
uses: actions/cache@v3
with:
path: /nix/store
path: /tmp/nix-cache
key: nix-store-${{ hashFiles('flake.nix', 'flake.lock', 'shell.nix') }}

- name: Restore Nix downloads cache
if: steps.nix-store-cache.outputs.cache-hit == 'true'
run: |
sudo rm -rf /nix
sudo mv /tmp/nix-cache /nix
sudo chown -R root /nix
- name: Cache Nodejs downloads
uses: actions/cache@v3
with:
Expand Down Expand Up @@ -58,3 +66,9 @@ jobs:
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
force_orphan: true

- name: Copy Nix store to cachable location
if: steps.nix-store-cache.outputs.cache-hit != 'true'
run: |
sudo cp -r --preserve=timestamps /nix /tmp/nix-cache
sudo rm -rf /tmp/nix-cache/var/nix/{daemon-socket/socket,userpool,gc.lock,db/big-lock,db/reserved}

0 comments on commit 5741164

Please sign in to comment.