bos55-nix-config-cicd/.github/workflows/build.yml
Tibo De Peuter 82ff6d6280
Some checks failed
Test / tests (push) Has been skipped
Build / Determining hosts to build (pull_request) Failing after 8s
Test / tests (pull_request) Has been skipped
Build / build (pull_request) Has been skipped
Use Forgejo output
2026-02-08 12:08:50 +01:00

46 lines
1.2 KiB
YAML

name: "Build"
on:
pull_request:
jobs:
determine_hosts:
name: "Determining hosts to build"
runs-on: ubuntu-latest
container:
image: catthehacker/ubuntu:act-latest
steps:
- uses: actions/checkout@v5
- uses: https://github.com/cachix/install-nix-action@v31
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: "List hosts"
id: hosts
run: |
hosts="$(nix eval .#nixosConfigurations --apply builtins.attrNames --json)"
echo "hostnames=${hosts}" >> "$FORGEJO_OUTPUT"
outputs:
hosts: ${{ steps.hosts.outputs.hostnames }}
build:
runs-on: ubuntu-latest
container:
image: catthehacker/ubuntu:act-latest
needs: determine_hosts
strategy:
matrix:
hostname: ${{ fromJSON(needs.determine_hosts.outputs.hosts) }}
steps:
- uses: actions/checkout@v5
- uses: https://github.com/cachix/install-nix-action@v31
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: "Define host"
env:
hostname: ${{ matrix.hostname }}
run: |
echo "Hostname: ${hostname}"
- run: |
nixos-rebuild build --flake ".#${hostname}"