Reusable action for Nix CI with caching: - DeterminateSystems/nix-installer-action for Nix installation - actions/cache@v4 for Nix store caching - Cache key based on flake.lock for per-repo isolation
42 lines
943 B
Markdown
42 lines
943 B
Markdown
# gitea-actions
|
|
|
|
Reusable Gitea Actions for CI workflows.
|
|
|
|
## Actions
|
|
|
|
### nix-setup
|
|
|
|
Installs Nix and sets up Nix store caching for Gitea Actions workflows.
|
|
|
|
**Features:**
|
|
- Uses DeterminateSystems/nix-installer-action for reliable Nix installation
|
|
- Caches `/nix/store`, `/nix/var/nix`, and `~/.cache/nix`
|
|
- Cache key based on `flake.lock` hash for automatic invalidation
|
|
- Each repo gets isolated cache (different flake.lock = different cache)
|
|
|
|
**Usage:**
|
|
|
|
```yaml
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: johno/gitea-actions/nix-setup@main
|
|
- run: nix flake check
|
|
```
|
|
|
|
**With custom cache prefix:**
|
|
|
|
```yaml
|
|
- uses: johno/gitea-actions/nix-setup@main
|
|
with:
|
|
cache-name: 'my-project-'
|
|
```
|
|
|
|
**Inputs:**
|
|
|
|
| Input | Description | Required | Default |
|
|
|-------|-------------|----------|---------|
|
|
| `cache-name` | Optional cache name prefix for disambiguation | No | `''` |
|