diff --git a/.gitea/workflows/web-deploy.yaml b/.gitea/workflows/web-deploy.yaml index 81c8594..e712336 100644 --- a/.gitea/workflows/web-deploy.yaml +++ b/.gitea/workflows/web-deploy.yaml @@ -4,17 +4,30 @@ on: [push, merge] jobs: setup-nixos-runner: - run-on: ubuntu-latest + run-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - uses: webfactory/ssh-agent@v0.9.0 with: ssh-private-key: ${{ secrets.WEB_PROXY_SSH_PRIVATE_KEY }} - uses: cachix/install-nix-action@v31 - - uses: actions/cache@v4 - with: - path: /nix/store + - name: Ensure known host name 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 - run: nix-shell shell.nix --run "nixos-rebuild switch --no-flake --target-host ${{ vars.WEB_PROXY_TARGET_HOST }}" \ No newline at end of file + 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 }} \ No newline at end of file