bos55-nix-config-cicd/.github/workflows/build.yml
Tibo De Peuter c04bce06b6
Some checks failed
Build / build (Development) (pull_request) Has been cancelled
Build / build (Testing) (pull_request) Has been cancelled
Build / Determining hosts to build (push) Successful in 43s
Build / build (Testing) (push) Failing after 14m31s
Build / build (Development) (push) Failing after 11m25s
Build / Determining hosts to build (pull_request) Failing after 12m25s
feat: Test Action
Including commits:
* chore: Disable test workflow
* Determine hosts
* Build each host
* Add NixOS to build step as well
* More specific hostnames
* fix json elements
* try different way
* Debug matrix
* run on push
* use var directly
* fix mappings
* fix mappings
* add toolcache
* Change names and ordere
* Debugging
* Debugging extra step
* Debugging needs outputs
* Debugging needs outputs hosts
* Preserve quotes
* printf escaped
* Using EOF
* test
* escape?
* without json parse
* hardcoding
* change build command
* Testing
2026-03-05 20:09:05 +01:00

43 lines
1.1 KiB
YAML

name: "Build"
on:
pull_request:
push:
jobs:
determine-hosts:
name: "Determining hosts to build"
runs-on: ubuntu-latest
container: catthehacker/ubuntu:act-24.04
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: catthehacker/ubuntu:act-24.04
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" --verbose