ci: only push to cachix on the main branch (#427)

This commit is contained in:
Ivan Petkov 2023-10-15 21:34:44 +00:00 committed by GitHub
parent 8cb0282cb7
commit 6f5679eb04
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -43,7 +43,7 @@ jobs:
- uses: cachix/cachix-action@v12
with:
name: crane
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
authToken: ${{ github.ref == 'refs/heads/master' && secrets.CACHIX_AUTH_TOKEN || '' }}
- name: flake checks
run: nix develop --accept-flake-config --command ./ci/fast-flake-check.sh ${{ matrix.nixpkgs-override }} -- --keep-going
- name: extra tests
@ -76,7 +76,7 @@ jobs:
- uses: cachix/cachix-action@v12
with:
name: crane
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
authToken: ${{ github.ref == 'refs/heads/master' && secrets.CACHIX_AUTH_TOKEN || '' }}
- name: validate examples
run: |
# Nix won't write a lockfile when --override-input is used (which is good because it will
@ -97,9 +97,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v23
- uses: cachix/cachix-action@v12
with:
name: deadnix
- uses: DeterminateSystems/magic-nix-cache-action@main
- name: check for dead code
run: nix run github:astro/deadnix -- .
@ -108,5 +106,6 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v23
- uses: DeterminateSystems/magic-nix-cache-action@main
- name: check formatting
run: nix fmt --accept-flake-config -- --check .