update nix ci action to use cachix to cache results (#2170)
This commit is contained in:
parent
95f6ae2bb6
commit
bff44b7097
1 changed files with 17 additions and 4 deletions
21
.github/workflows/nix.yml
vendored
21
.github/workflows/nix.yml
vendored
|
|
@ -1,15 +1,21 @@
|
||||||
name: LNbits CI / nix
|
name: LNbits CI / nix
|
||||||
|
|
||||||
|
# - run : on main, dev, nix and cachix branches when relevant files change
|
||||||
|
# - cache : on main, dev and cachix branches when relevant files change
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
- dev
|
- dev
|
||||||
|
- nix
|
||||||
|
- cachix
|
||||||
paths:
|
paths:
|
||||||
- 'flake.nix'
|
- 'flake.nix'
|
||||||
- 'flake.lock'
|
- 'flake.lock'
|
||||||
- 'pyproject.toml'
|
- 'pyproject.toml'
|
||||||
- 'poetry.lock'
|
- 'poetry.lock'
|
||||||
|
- '.github/workflows/nix.yml'
|
||||||
pull_request:
|
pull_request:
|
||||||
paths:
|
paths:
|
||||||
- 'flake.nix'
|
- 'flake.nix'
|
||||||
|
|
@ -21,8 +27,15 @@ jobs:
|
||||||
nix:
|
nix:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
- uses: cachix/install-nix-action@v23
|
- uses: cachix/install-nix-action@v24
|
||||||
with:
|
with:
|
||||||
nix_path: nixpkgs=channel:nixos-unstable
|
nix_path: nixpkgs=channel:nixos-23.11
|
||||||
- run: nix build
|
- uses: cachix/cachix-action@v13
|
||||||
|
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev' || github.ref == 'refs/heads/cachix'
|
||||||
|
with:
|
||||||
|
name: lnbits
|
||||||
|
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
|
||||||
|
- run: nix build -L
|
||||||
|
- run: cachix push lnbits ./result
|
||||||
|
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev' || github.ref == 'refs/heads/cachix'
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue