Skip to content

Commit

Permalink
Update ci configurations
Browse files Browse the repository at this point in the history
  • Loading branch information
linyinfeng committed Sep 10, 2021
1 parent b6c87fd commit 9c0c33d
Show file tree
Hide file tree
Showing 16 changed files with 145 additions and 235 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/check-and-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: "Check and Deploy"

on:
push:
pull_request:
workflow_dispatch:

jobs:
check-and-deploy:
runs-on: [self-hosted, linux, X64]
steps:
- name: Checkout
uses: actions/checkout@master
- name: Format check
run: nix run nixpkgs#nixpkgs-fmt -- . --check
- name: Check
run: nix flake check --verbose --print-build-logs
- name: Push cache
run: |
for host in portal x200s; do
nix build ".#nixosConfigurations.portal.config.system.build.toplevel" --json | \
nix run nixpkgs#jq -- ".[].outputs.out" --raw-output | \
nix run nixpkgs#cachix -- push linyinfeng
done
env:
CACHIX_SIGNING_KEY: ${{ secrets.CACHIX_SIGNING_KEY }}
- name: Install SSH key
if: ${{ github.ref == 'refs/heads/main' }}
uses: shimataro/ssh-key-action@develop
with:
key: ${{ secrets.SSH_KEY }}
name: id_rsa
known_hosts: ${{ secrets.KNOWN_HOSTS }}
- name: Deploy
if: ${{ github.ref == 'refs/heads/main' }}
run: |
for host in portal x200s; do
nix develop --command deploy --skip-checks ".#$host"
done
28 changes: 0 additions & 28 deletions .github/workflows/check.yml

This file was deleted.

44 changes: 0 additions & 44 deletions .github/workflows/check_and_deploy.yml

This file was deleted.

27 changes: 0 additions & 27 deletions .github/workflows/mdbook_docs.yml

This file was deleted.

71 changes: 0 additions & 71 deletions .github/workflows/release.yml

This file was deleted.

1 change: 1 addition & 0 deletions ci.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(import ./.).ciNix
34 changes: 3 additions & 31 deletions default.nix
Original file line number Diff line number Diff line change
@@ -1,31 +1,3 @@
let
inherit (default.inputs.nixos) lib;

default = (import ./lib/compat).defaultNix;

ciSystems = [
"aarch64-linux"
"i686-linux"
"x86_64-linux"
];

filterSystems = lib.filterAttrs
(system: _: lib.elem system ciSystems);

recurseIntoAttrsRecursive = lib.mapAttrs (_: v:
if lib.isAttrs v
then recurseIntoAttrsRecursive (lib.recurseIntoAttrs v)
else v
);

systemOutputs = lib.filterAttrs
(name: set: lib.isAttrs set
&& lib.any
(system: set ? ${system} && name != "legacyPackages")
ciSystems
)
default.outputs;

ciDrvs = lib.mapAttrs (_: system: filterSystems system) systemOutputs;
in
(recurseIntoAttrsRecursive ciDrvs) // { shell = import ./shell.nix; }
if builtins ? getFlake
then builtins.getFlake (toString ./.)
else (import ./lib/compat).defaultNix
57 changes: 39 additions & 18 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 9c0c33d

Please sign in to comment.