Fix: hugo autobuild
This commit is contained in:
parent
da8f43f652
commit
41c8f8dd05
1 changed files with 34 additions and 20 deletions
|
|
@ -4,25 +4,39 @@
|
||||||
];
|
];
|
||||||
systemd.services.hugo-build = {
|
systemd.services.hugo-build = {
|
||||||
description = "Auto build du blog hugo";
|
description = "Auto build du blog hugo";
|
||||||
after = [ "network-online.target" ];
|
|
||||||
wants = [ "network-online.target" ];
|
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
Type = "oneshot";
|
Type = "oneshot";
|
||||||
WorkingDirectory = "/srv/blog" ;
|
WorkingDirectory = "/srv/blog" ;
|
||||||
ExecStart = ''
|
ExecStart = ''${pkgs.hugo}/bin/hugo --minify build -d /srv/blog/public'';
|
||||||
${pkgs.git}/bin/git pull origin master
|
|
||||||
${pkgs.hugo}/bin/hugo --minify build -d /srv/blog/public
|
|
||||||
'';
|
|
||||||
User = "lomig";
|
User = "lomig";
|
||||||
};
|
};
|
||||||
environment = {
|
|
||||||
PATH = lib.mkForce "${pkgs.git}/bin:${pkgs.hugo}/bin:${pkgs.openssh}/bin";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
systemd.timers.hugo-build = {
|
systemd.timers.hugo-build = {
|
||||||
description = "Timer pour rebuild du blog";
|
description = "Timer pour rebuild du blog";
|
||||||
wantedBy = [ "timers.target" ];
|
wantedBy = [ "timers.target" ];
|
||||||
timerConfig.OnCalendar = "daily" ;
|
timerConfig = {
|
||||||
|
OnCalendar = "01:10" ;
|
||||||
|
Persistent = true ;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
systemd.services.blog-sync = {
|
||||||
|
description = "Synchronisation du dépôt Hugo";
|
||||||
|
serviceConfig = {
|
||||||
|
Type = "oneshot";
|
||||||
|
WorkingDirectory = "/srv/blog";
|
||||||
|
ExecStart = "${pkgs.git}/bin/git pull origin master";
|
||||||
|
User = "lomig";
|
||||||
|
};
|
||||||
|
environment = {
|
||||||
|
PATH = lib.mkForce "${pkgs.openssh}/bin";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
systemd.timers.blog-sync = {
|
||||||
|
wantedBy = [ "timers.target" ];
|
||||||
|
timerConfig = {
|
||||||
|
OnCalendar = "01:00";
|
||||||
|
Persistent = true;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
services.caddy = {
|
services.caddy = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue