split runners into separate arch types
This commit is contained in:
parent
17b3fba5f6
commit
9e806117ff
2 changed files with 81 additions and 86 deletions
|
@ -34,43 +34,24 @@ jobs:
|
||||||
- name: Garbage collect build dependencies
|
- name: Garbage collect build dependencies
|
||||||
run: nix-collect-garbage
|
run: nix-collect-garbage
|
||||||
|
|
||||||
- name: Build new ${{ matrix.system }} system
|
- name: Build new ${{ matrix.system }} system and push to cachix
|
||||||
|
id: "build"
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
nix build \
|
DRVOUT=$(nix build ".#deploy-json.${{ matrix.system }}" --print-out-paths)
|
||||||
".#top.${{ matrix.system }}" \
|
::set-output name=build_output::$DRVOUT
|
||||||
--profile ./profile \
|
- name: Push cache for ${{ matrix.system }} to cachix
|
||||||
--fallback \
|
id: "push-to-cachix"
|
||||||
-v \
|
|
||||||
--log-format raw \
|
|
||||||
> >(tee stdout.log) 2> >(tee /tmp/nix-build-err.log >&2)
|
|
||||||
- name: Push to Cachix
|
|
||||||
if: success()
|
if: success()
|
||||||
env:
|
env:
|
||||||
CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}
|
CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
nix build .#deploy-json --print-out-paths | cachix push hsndev
|
echo ${{steps.build_push.outputs.build_output}} | cachix push hsndev
|
||||||
|
- name: Deploy ${{ matrix.system }} runners
|
||||||
nix-build-success:
|
id: "deploy"
|
||||||
if: ${{ always() }}
|
|
||||||
needs:
|
|
||||||
- nix-build
|
|
||||||
name: Nix Build Successful
|
|
||||||
runs-on: docker
|
|
||||||
steps:
|
|
||||||
- if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}
|
|
||||||
name: Check matrix status
|
|
||||||
run: exit 1
|
|
||||||
deploy:
|
|
||||||
if: success()
|
if: success()
|
||||||
needs:
|
|
||||||
- nix-build-success
|
|
||||||
runs-on: docker
|
|
||||||
env:
|
env:
|
||||||
CACHIX_ACTIVATE_TOKEN: ${{ secrets.CACHIX_ACTIVATE_TOKEN }}
|
CACHIX_ACTIVATE_TOKEN: ${{ secrets.CACHIX_ACTIVATE_TOKEN }}
|
||||||
steps:
|
|
||||||
- name: Deploy Runners
|
|
||||||
run: |
|
run: |
|
||||||
spec=$(nix build .#deploy-json --print-out-paths)
|
cachix deploy activate ${{ steps.build_push.outputs.build_output }}
|
||||||
cachix deploy activate $spec
|
|
18
flake.nix
18
flake.nix
|
@ -81,13 +81,13 @@
|
||||||
{
|
{
|
||||||
"fj-hetzner-aarch64-01" = lib.nixosSystem {
|
"fj-hetzner-aarch64-01" = lib.nixosSystem {
|
||||||
system = "aarch64-linux";
|
system = "aarch64-linux";
|
||||||
specialArgs = {inherit inputs; };
|
specialArgs = { inherit inputs; };
|
||||||
modules = aarch64-linux-modules;
|
modules = aarch64-linux-modules;
|
||||||
};
|
};
|
||||||
|
|
||||||
"fj-shadowfax-01" = lib.nixosSystem {
|
"fj-shadowfax-01" = lib.nixosSystem {
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
specialArgs = {inherit inputs; };
|
specialArgs = { inherit inputs; };
|
||||||
modules = x86_64-linux-modules;
|
modules = x86_64-linux-modules;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -110,7 +110,10 @@
|
||||||
|
|
||||||
# Constructs a deploy.json output that can be used to deploy the runners
|
# Constructs a deploy.json output that can be used to deploy the runners
|
||||||
# https://docs.cachix.org/deploy/reference#deploy-json
|
# https://docs.cachix.org/deploy/reference#deploy-json
|
||||||
|
|
||||||
deploy-json =
|
deploy-json =
|
||||||
|
{
|
||||||
|
"aarch64-linux" =
|
||||||
let
|
let
|
||||||
inherit (common "aarch64-linux") cachix-deploy-lib;
|
inherit (common "aarch64-linux") cachix-deploy-lib;
|
||||||
in
|
in
|
||||||
|
@ -125,6 +128,15 @@
|
||||||
# system = "aarch64-linux";
|
# system = "aarch64-linux";
|
||||||
imports = aarch64-linux-modules;
|
imports = aarch64-linux-modules;
|
||||||
};
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
"x86_64-linux" =
|
||||||
|
let
|
||||||
|
inherit (common "x86_64-linux") cachix-deploy-lib;
|
||||||
|
in
|
||||||
|
cachix-deploy-lib.spec
|
||||||
|
{
|
||||||
|
agents = {
|
||||||
"fj-shadowfax-01" =
|
"fj-shadowfax-01" =
|
||||||
let
|
let
|
||||||
inherit (common "x86_64-linux") cachix-deploy-lib pkgs;
|
inherit (common "x86_64-linux") cachix-deploy-lib pkgs;
|
||||||
|
@ -134,6 +146,8 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
};
|
||||||
|
|
||||||
# Convenience output that aggregates the outputs for home, nixos.
|
# Convenience output that aggregates the outputs for home, nixos.
|
||||||
# Also used in ci to build targets generally.
|
# Also used in ci to build targets generally.
|
||||||
top =
|
top =
|
||||||
|
|
Loading…
Reference in a new issue