mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-03-22 15:29:07 +01:00
workflows/ci: Don't build packages and workstations
This commit is contained in:
parent
5378787ac0
commit
ab59f54471
2 changed files with 20 additions and 76 deletions
30
.github/workflows/build-host.yml
vendored
30
.github/workflows/build-host.yml
vendored
|
|
@ -1,30 +0,0 @@
|
||||||
name: Build host
|
|
||||||
on:
|
|
||||||
workflow_call:
|
|
||||||
inputs:
|
|
||||||
hosts:
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
secrets:
|
|
||||||
CACHIX_AUTH_TOKEN:
|
|
||||||
required: true
|
|
||||||
jobs:
|
|
||||||
build-host:
|
|
||||||
name: ${{ matrix.host }}
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
host: ${{ fromJson(inputs.hosts) }}
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v5
|
|
||||||
- uses: cachix/install-nix-action@v31
|
|
||||||
with:
|
|
||||||
extra_nix_config: experimental-features = nix-command flakes pipe-operators
|
|
||||||
- uses: cachix/cachix-action@v15
|
|
||||||
with:
|
|
||||||
name: sebastian-stork
|
|
||||||
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
|
|
||||||
useDaemon: false
|
|
||||||
- name: Build host
|
|
||||||
run: nix build .#nixosConfigurations.${{ matrix.host }}.config.system.build.toplevel --print-build-logs
|
|
||||||
66
.github/workflows/ci.yml
vendored
66
.github/workflows/ci.yml
vendored
|
|
@ -16,11 +16,6 @@ jobs:
|
||||||
- uses: cachix/install-nix-action@v31
|
- uses: cachix/install-nix-action@v31
|
||||||
with:
|
with:
|
||||||
extra_nix_config: experimental-features = nix-command flakes pipe-operators
|
extra_nix_config: experimental-features = nix-command flakes pipe-operators
|
||||||
- name: Get packages
|
|
||||||
id: packages
|
|
||||||
run: |
|
|
||||||
packages=$(nix flake show --json | jq -c '.packages."x86_64-linux" | keys')
|
|
||||||
printf "packages=%s" "$packages" >> "$GITHUB_OUTPUT"
|
|
||||||
- name: Get checks
|
- name: Get checks
|
||||||
id: checks
|
id: checks
|
||||||
run: |
|
run: |
|
||||||
|
|
@ -32,38 +27,11 @@ jobs:
|
||||||
servers=$(nix eval .#nixosConfigurations --apply 'configs:
|
servers=$(nix eval .#nixosConfigurations --apply 'configs:
|
||||||
configs
|
configs
|
||||||
|> builtins.attrNames
|
|> builtins.attrNames
|
||||||
|> builtins.filter (name: configs.${name}.config.custom.services.comin.enable)
|
|> builtins.filter (hostName: configs.${hostName}.config.custom.services.comin.enable)
|
||||||
' --json)
|
' --json)
|
||||||
printf "servers=%s" "$servers" >> "$GITHUB_OUTPUT"
|
printf "servers=%s" "$servers" >> "$GITHUB_OUTPUT"
|
||||||
- name: Get workstations
|
|
||||||
id: workstations
|
|
||||||
run: |
|
|
||||||
workstations=$(nix eval .#nixosConfigurations --apply 'configs:
|
|
||||||
configs
|
|
||||||
|> builtins.attrNames
|
|
||||||
|> builtins.filter (name: !configs.${name}.config.custom.services.comin.enable)
|
|
||||||
' --json)
|
|
||||||
printf "workstations=%s" "$workstations" >> "$GITHUB_OUTPUT"
|
|
||||||
build-package:
|
|
||||||
needs: parse-flake
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
package: ${{ fromJson(needs.parse-flake.outputs.packages) }}
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v5
|
|
||||||
- uses: cachix/install-nix-action@v31
|
|
||||||
with:
|
|
||||||
extra_nix_config: experimental-features = nix-command flakes pipe-operators
|
|
||||||
- uses: cachix/cachix-action@v15
|
|
||||||
with:
|
|
||||||
name: sebastian-stork
|
|
||||||
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
|
|
||||||
useDaemon: false
|
|
||||||
- name: Build package
|
|
||||||
run: nix build .#packages.x86_64-linux.${{ matrix.package }} --print-build-logs
|
|
||||||
build-check:
|
build-check:
|
||||||
|
name: ${{ matrix.check }}
|
||||||
needs: parse-flake
|
needs: parse-flake
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
|
|
@ -83,19 +51,25 @@ jobs:
|
||||||
- name: Build check
|
- name: Build check
|
||||||
run: nix build .#checks.x86_64-linux.${{ matrix.check }} --print-build-logs
|
run: nix build .#checks.x86_64-linux.${{ matrix.check }} --print-build-logs
|
||||||
build-server:
|
build-server:
|
||||||
|
name: ${{ matrix.server }}
|
||||||
needs: parse-flake
|
needs: parse-flake
|
||||||
uses: ./.github/workflows/build-host.yml
|
runs-on: ubuntu-latest
|
||||||
with:
|
strategy:
|
||||||
hosts: ${{ needs.parse-flake.outputs.servers }}
|
fail-fast: false
|
||||||
secrets:
|
matrix:
|
||||||
CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}
|
server: ${{ fromJson(needs.parse-flake.outputs.servers) }}
|
||||||
build-workstation:
|
steps:
|
||||||
needs: parse-flake
|
- uses: actions/checkout@v5
|
||||||
uses: ./.github/workflows/build-host.yml
|
- uses: cachix/install-nix-action@v31
|
||||||
with:
|
with:
|
||||||
hosts: ${{ needs.parse-flake.outputs.workstations }}
|
extra_nix_config: experimental-features = nix-command flakes pipe-operators
|
||||||
secrets:
|
- uses: cachix/cachix-action@v15
|
||||||
CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}
|
with:
|
||||||
|
name: sebastian-stork
|
||||||
|
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
|
||||||
|
useDaemon: false
|
||||||
|
- name: Build server
|
||||||
|
run: nix build .#nixosConfigurations.${{ matrix.server }}.config.system.build.toplevel --print-build-logs
|
||||||
deploy:
|
deploy:
|
||||||
needs: [build-check, build-server]
|
needs: [build-check, build-server]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue