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
|
||||
run: nix-collect-garbage
|
||||
|
||||
- name: Build new ${{ matrix.system }} system
|
||||
- name: Build new ${{ matrix.system }} system and push to cachix
|
||||
id: "build"
|
||||
shell: bash
|
||||
run: |
|
||||
set -o pipefail
|
||||
nix build \
|
||||
".#top.${{ matrix.system }}" \
|
||||
--profile ./profile \
|
||||
--fallback \
|
||||
-v \
|
||||
--log-format raw \
|
||||
> >(tee stdout.log) 2> >(tee /tmp/nix-build-err.log >&2)
|
||||
- name: Push to Cachix
|
||||
DRVOUT=$(nix build ".#deploy-json.${{ matrix.system }}" --print-out-paths)
|
||||
::set-output name=build_output::$DRVOUT
|
||||
- name: Push cache for ${{ matrix.system }} to cachix
|
||||
id: "push-to-cachix"
|
||||
if: success()
|
||||
env:
|
||||
CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}
|
||||
run: |
|
||||
nix build .#deploy-json --print-out-paths | cachix push hsndev
|
||||
|
||||
nix-build-success:
|
||||
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:
|
||||
echo ${{steps.build_push.outputs.build_output}} | cachix push hsndev
|
||||
- name: Deploy ${{ matrix.system }} runners
|
||||
id: "deploy"
|
||||
if: success()
|
||||
needs:
|
||||
- nix-build-success
|
||||
runs-on: docker
|
||||
env:
|
||||
CACHIX_ACTIVATE_TOKEN: ${{ secrets.CACHIX_ACTIVATE_TOKEN }}
|
||||
steps:
|
||||
- name: Deploy Runners
|
||||
run: |
|
||||
spec=$(nix build .#deploy-json --print-out-paths)
|
||||
cachix deploy activate $spec
|
||||
cachix deploy activate ${{ steps.build_push.outputs.build_output }}
|
14
flake.nix
14
flake.nix
|
@ -110,7 +110,10 @@
|
|||
|
||||
# Constructs a deploy.json output that can be used to deploy the runners
|
||||
# https://docs.cachix.org/deploy/reference#deploy-json
|
||||
|
||||
deploy-json =
|
||||
{
|
||||
"aarch64-linux" =
|
||||
let
|
||||
inherit (common "aarch64-linux") cachix-deploy-lib;
|
||||
in
|
||||
|
@ -125,6 +128,15 @@
|
|||
# system = "aarch64-linux";
|
||||
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" =
|
||||
let
|
||||
inherit (common "x86_64-linux") cachix-deploy-lib pkgs;
|
||||
|
@ -134,6 +146,8 @@
|
|||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# Convenience output that aggregates the outputs for home, nixos.
|
||||
# Also used in ci to build targets generally.
|
||||
top =
|
||||
|
|
Loading…
Reference in a new issue