name: build
on:
  pull_request:
jobs:
  build:
    container:
      image: node:24-bookworm
      env:
        USER: node
        HOME: /home/node
        NIX_CONFIG: experimental-features = nix-command flakes
      volumes:
        - /var/lib/pbri/docker/nix_runner_nix:/nix
        - /var/lib/pbri/docker/nix_runner_etc:/etc/nix
        - /var/lib/pbri/docker/nix_runner_home_node:/home/node
      options: --user 1000:1000
    steps:
      - name: Prep nix env
        run: |
          if [ ! -f ~/.nix-profile/etc/profile.d/nix.sh ]; then
            curl -L https://nixos.org/nix/install | bash -s -- --no-daemon
          fi
          . ~/.nix-profile/etc/profile.d/nix.sh 
          env >> "$GITHUB_ENV"
      - name: Checkout repo
        uses: actions/checkout@v4
      - run: nix build --log-format raw --print-build-logs .#yore
