configuration.nix/.github/workflows/check.yml
Jalil David Salamé Messina 61dc6b7467
All checks were successful
/ check (push) Successful in 23s
/ build (audiomenu) (push) Successful in 1s
/ build (docs) (push) Successful in 1s
/ build (jpassmenu) (push) Successful in 1s
/ build (nixosConfigurations.vm.config.system.build.toplevel) (push) Successful in 1s
/ build (nvim) (push) Successful in 11s
/ update-lockfile (push) Has been skipped
fix(ci): install through nix installer action
The lix image thing is too broken (due to actions expecting things to be
in /usr/bin
2024-07-29 16:17:16 +02:00

66 lines
2.1 KiB
YAML

name: Check flake
on:
push:
branches: [main]
path:
- ./**.nix
- ./flake.lock
pull_request:
# scheduled runs are run on my own infrastructure
# schedule:
# - cron: 5 4 * * 5 # At 04:05 on Friday.
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@v13
with:
source-url: "https://install.lix.systems/lix/lix-installer-x86_64-linux"
- uses: DeterminateSystems/magic-nix-cache-action@v7
- name: Run `nix flake check`
run: |
nix flake check --verbose --keep-going
nix run nixpkgs#statix -- check .
lockfile:
runs-on: ubuntu-latest
needs: check
if: ${{ github.event_name == 'schedule' }} # only run when scheduled
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@v13
with:
source-url: "https://install.lix.systems/lix/lix-installer-x86_64-linux"
- uses: DeterminateSystems/update-flake-lock@v23
- name: Run `nix flake check`
run: nix flake check --verbose --keep-going
build-docs:
runs-on: ubuntu-latest
if: ${{ github.event_name != 'schedule' }} # only run when not scheduled
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/magic-nix-cache-action@v7
- uses: DeterminateSystems/nix-installer-action@v13
with:
source-url: "https://install.lix.systems/lix/lix-installer-x86_64-linux"
- name: Build documentation
run: nix build .#docs --print-build-logs
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./result
deploy-docs:
runs-on: ubuntu-latest
needs: build-docs
if: ${{ github.event_name == 'push' }} # only run on main branch
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4