nixlets/ci.nix

48 lines
1,020 B
Nix
Raw Normal View History

2024-03-09 15:32:47 +01:00
{
ci = {
2025-04-27 16:03:23 +02:00
stages = ["check" "build" "deploy"];
2024-03-09 15:32:47 +01:00
jobs = {
"check" = {
stage = "check";
script = [
"nix flake check --impure"
];
};
2025-04-27 16:03:23 +02:00
"docs" = {
stage = "build";
script = [
# sh
''
nix build .#docs:default
mkdir -p public
cp -r result/. public/
''
];
artifacts.paths = ["public"];
};
"pages" = {
nix.enable = false;
image = "alpine:latest";
stage = "deploy";
script = ["true"];
artifacts.paths = ["public"];
rules = [
{
"if" = "$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH";
}
];
};
2024-05-08 17:09:17 +00:00
"upload" = {
2025-04-27 16:03:23 +02:00
stage = "deploy";
2024-05-08 17:09:17 +00:00
rules = [
{"if" = ''$CI_COMMIT_REF_NAME == "main"'';}
];
variables.AUTH_HEADER = "JOB-TOKEN: \${CI_JOB_TOKEN}";
script = [
"nix run .#upload --impure"
];
};
2024-03-09 15:32:47 +01:00
};
};
}