forked from Bos55/nix-config
48 lines
1.2 KiB
YAML
48 lines
1.2 KiB
YAML
name: "Build"
|
|
on:
|
|
pull_request:
|
|
push:
|
|
|
|
env:
|
|
RUNNER_TOOL_CACHE: /toolcache
|
|
|
|
jobs:
|
|
determine-hosts:
|
|
name: "Determining hosts to build"
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: catthehacker/ubuntu:act-latest
|
|
outputs:
|
|
hosts: ${{ steps.hosts.outputs.hostnames }}
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
- uses: https://github.com/cachix/install-nix-action@v31
|
|
with:
|
|
nix_path: nixpkgs=channel:nixos-unstable
|
|
- name: "Determine hosts"
|
|
id: hosts
|
|
run: |
|
|
hostnames="$(nix eval .#nixosConfigurations --apply builtins.attrNames --json)"
|
|
printf "hostnames=%s\n" "${hostnames}" >> "${GITHUB_OUTPUT}"
|
|
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: catthehacker/ubuntu:act-latest
|
|
needs: determine-hosts
|
|
strategy:
|
|
matrix:
|
|
hostname: [
|
|
Development
|
|
Testing
|
|
]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
- uses: https://github.com/cachix/install-nix-action@v31
|
|
with:
|
|
nix_path: nixpkgs=channel:nixos-unstable
|
|
- name: "Build host"
|
|
run: |
|
|
nix build ".#nixosConfigurations.${{ matrix.hostname }}.config.system.build.toplevel"
|
|
|