test #2
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: "Nix Housekeeping" | |
| on: | |
| push: | |
| branches: | |
| - master | |
| - dev-nix-cache | |
| workflow_dispatch: {} | |
| jobs: | |
| shell: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: 📥 Clone repository | |
| uses: actions/checkout@v6 | |
| with: | |
| repository: ${{ inputs.checkout_repo || github.repository }} | |
| ref: ${{ inputs.checkout_ref || '' }} | |
| - name: ❄ Install Nix | |
| uses: DeterminateSystems/nix-installer-action@main | |
| with: | |
| extra-conf: | | |
| extra-substituters = https://graphite.cachix.org https://graphite-dev.cachix.org | |
| extra-trusted-public-keys = graphite.cachix.org-1:B7Il1yMpkquN/dXM+5GRmz+4Xmu2aaCS1GcWNfFhsOo= graphite-dev.cachix.org-1:RppXYpiV1qO2TYKTkXXGHsAEQDOB5G51b3VlrN9QmbI= | |
| - name: 🔎 Check whether dev shell is already in Cachix | |
| id: cache-check | |
| run: | | |
| if nix path-info --store "https://graphite-dev.cachix.org" .#devShells.x86_64-linux.default >/dev/null 2>&1; then | |
| echo "cached=true" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "cached=false" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: 📦 Build Nix development shell | |
| if: steps.cache-check.outputs.cached == 'false' | |
| run: nix build .#devShells.x86_64-linux.default --no-link --print-out-paths | |
| - name: 📤 Push Nix development shell to binary cache | |
| if: steps.cache-check.outputs.cached == 'false' | |
| env: | |
| NIX_CACHE_AUTH_TOKEN: ${{ secrets.NIX_CACHE_AUTH_TOKEN_DEV }} | |
| run: | | |
| nix run nixpkgs#cachix -- authtoken $NIX_CACHE_AUTH_TOKEN | |
| nix build .#devShells.x86_64-linux.default --no-link --print-out-paths | nix run nixpkgs#cachix -- push graphite-dev |