diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e752cdf..26ced04 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,13 +6,28 @@ on: - master jobs: - build: + + define-matrix: runs-on: ubuntu-latest + outputs: + hosts: $ + steps: - - uses: jlumbroso/free-disk-space@main - with: - large-packages: false + - uses: actions/checkout@v4 + + - name: Define hosts + run: | + hosts=[$(nix flake show --json | jq '.nixosConfigurations | keys[]' | paste -sd, -)] + echo "hosts=$hosts" >> $GITHUB_OUTPUT + build: + runs-on: ubuntu-latest + needs: define-matrix + strategy: + matrix: + host: ${{ fromJSON(needs.define-matrix.outputs.hosts) }} + + steps: - uses: actions/checkout@v4 - uses: cachix/install-nix-action@v27 @@ -27,13 +42,9 @@ jobs: with: name: joinemm authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' - - - name: build all hosts + + - name: Build ${{ matrix.host }} + env: + host: ${{ matrix.host }} run: | - set -e - for host in `nix flake show --json | jq '.nixosConfigurations | keys[]'`; do - echo "--- Building configuration for \"$host\" ---" - nix build .#nixosConfigurations.$host.config.system.build.toplevel --no-link - nix-collect-garbage - done - + nix build .#nixosConfigurations.$host.config.system.build.toplevel