Deploy basic site with netlify

This commit is contained in:
Robert Hensing 2022-05-18 00:41:17 +02:00
parent 0263a393a2
commit 13fc0c610b
5 changed files with 126 additions and 9 deletions

View file

@ -3,6 +3,7 @@ flakeModuleArgs@{ config, lib, inputs, ... }:
{
imports = [
inputs.pre-commit-hooks-nix.flakeModule
../site/flake-module.nix
];
systems = [ "x86_64-linux" "aarch64-darwin" ];
perSystem = system: { config, self', inputs', pkgs, ... }: {
@ -11,6 +12,9 @@ flakeModuleArgs@{ config, lib, inputs, ... }:
nativeBuildInputs = [
pkgs.nixpkgs-fmt
pkgs.pre-commit
pkgs.hci
pkgs.netlify-cli
pkgs.pandoc
];
shellHook = ''
${config.pre-commit.installationScript}
@ -43,9 +47,22 @@ flakeModuleArgs@{ config, lib, inputs, ... }:
};
flake = {
options.herculesCI = lib.mkOption { type = lib.types.raw; };
config.herculesCI = {
config.herculesCI = { branch, ... }: {
onPush.default.outputs = {
inherit (config.flake) packages checks;
effects =
let
pkgs = inputs.nixpkgs.legacyPackages.x86_64-linux;
effects = inputs.hercules-ci-effects.lib.withPkgs pkgs;
in
{
netlifyDeploy = effects.runIf (branch == "main") (effects.netlifyDeploy {
content = config.flake.packages.x86_64-linux.websitePackage;
secretName = "default-netlify";
siteId = "29a153b1-3698-433c-bc73-62415efb8117";
productionDeployment = true;
});
};
};
};