mirror of
https://github.com/hercules-ci/flake-parts.git
synced 2024-12-14 11:47:31 +00:00
Use flakeModule based automatic herculesCI.onPush
This commit is contained in:
parent
d8f05073ae
commit
45fc384fe3
2 changed files with 14 additions and 18 deletions
|
@ -4,6 +4,7 @@ let
|
|||
self = {
|
||||
inherit (flake) inputs;
|
||||
outPath = ../.; # used by pre-commit module, etc
|
||||
outputs = self.config.flake;
|
||||
} //
|
||||
fmc-lib.evalFlakeModule
|
||||
{ inherit self; }
|
||||
|
|
|
@ -30,25 +30,20 @@
|
|||
};
|
||||
|
||||
};
|
||||
flake = {
|
||||
# Because of ./README.md, we can't use the built-in flake support, including
|
||||
# the `effects` flake attribute. We have to define `herculesCI` ourselves.
|
||||
options.herculesCI = lib.mkOption { type = lib.types.raw; };
|
||||
config.herculesCI = { branch, ... }: {
|
||||
herculesCI = herculesCI@{ config, ... }: {
|
||||
onPush.default.outputs = {
|
||||
inherit (config.flake) packages checks;
|
||||
effects =
|
||||
withSystem "x86_64-linux" ({ config, pkgs, effects, ... }: {
|
||||
netlifyDeploy = effects.netlifyDeploy {
|
||||
content = config.packages.siteContent;
|
||||
secretName = "default-netlify";
|
||||
siteId = "29a153b1-3698-433c-bc73-62415efb8117";
|
||||
productionDeployment = branch == "main";
|
||||
productionDeployment = herculesCI.config.repo.branch == "main";
|
||||
};
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
flake = {
|
||||
# for repl exploration / debug
|
||||
config.config = config;
|
||||
options.mySystem = lib.mkOption { default = config.allSystems.${builtins.currentSystem}; };
|
||||
|
|
Loading…
Reference in a new issue