mirror of
https://github.com/HendrikRauh/inventree-app.git
synced 2026-02-04 17:03:19 +00:00
This commit is contained in:
parent
e3e67f5b29
commit
5df60697a3
2 changed files with 66 additions and 0 deletions
29
.github/actions/nix-devshell/action.yml
vendored
29
.github/actions/nix-devshell/action.yml
vendored
|
|
@ -12,6 +12,14 @@ inputs:
|
|||
"Commands to run inside the devshell (executed with bash -lc)."
|
||||
required: false
|
||||
default: ""
|
||||
cachix_cache:
|
||||
description: "Optional Cachix cache name to use (e.g. myorg). Requires `cachix_auth` for private caches."
|
||||
required: false
|
||||
default: ""
|
||||
cachix_auth:
|
||||
description: "Optional Cachix auth token used to access private caches (pass via secrets)."
|
||||
required: false
|
||||
default: ""
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
|
|
@ -29,6 +37,27 @@ runs:
|
|||
fi
|
||||
nix --version
|
||||
|
||||
- name: (Optional) Configure Cachix binary cache
|
||||
if: ${{ inputs.cachix_cache != '' }}
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
# install cachix CLI if absent (via nix)
|
||||
if ! command -v cachix >/dev/null 2>&1; then
|
||||
if command -v nix >/dev/null 2>&1; then
|
||||
nix profile install nixpkgs#cachix || true
|
||||
else
|
||||
echo "nix not available - cannot install cachix"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
# authenticate if auth token provided (for private caches)
|
||||
if [ -n "${{ inputs.cachix_auth }}" ]; then
|
||||
echo "${{ inputs.cachix_auth }}" | cachix authtoken - || true
|
||||
fi
|
||||
# use the provided cachix cache
|
||||
cachix use "${{ inputs.cachix_cache }}" || true
|
||||
|
||||
- name: Prebuild devshell
|
||||
if: ${{ inputs.prebuild == 'true' }}
|
||||
shell: bash
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue