diff --git a/.forgejo/workflows/deploy.yaml b/.forgejo/workflows/deploy.yaml index 1e4c53d..00669e4 100644 --- a/.forgejo/workflows/deploy.yaml +++ b/.forgejo/workflows/deploy.yaml @@ -4,11 +4,23 @@ jobs: deploy: runs_on: docker steps: + - name: "Cache Nix store" + uses: actions/cache@v3.0.8 + id: nix-cache + with: + path: /tmp/nixcache + key: "${{ runner.os }}-nix-cache" - uses: actions/checkout@v4 with: ref: master - uses: https://github.com/DeterminateSystems/nix-installer-action@main + - name: "Import Nix store cache" + if: "steps.nix-cache.outputs.cache-hit == 'true'" + run: "nix-store --import < /tmp/nixcache" - uses: https://github.com/LuisEnMarroquin/setup-ssh-action@v2.0.5 with: SSHKEY: ${{ secrets.DEPLOYKEY }} - - run: 'nix develop --command deploy .' \ No newline at end of file + - run: 'nix develop --command deploy .' + - name: "Export Nix store cache" + if: "steps.nix-cache.outputs.cache-hit != 'true'" + run: "nix-store --export $(find /nix/store -maxdepth 1 -name '*-*') > /tmp/nixcache" \ No newline at end of file