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 = {
|
||||
description = "Auto build du blog hugo";
|
||||
after = [ "network-online.target" ];
|
||||
wants = [ "network-online.target" ];
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
WorkingDirectory = "/srv/blog" ;
|
||||
ExecStart = ''
|
||||
${pkgs.git}/bin/git pull origin master
|
||||
${pkgs.hugo}/bin/hugo --minify build -d /srv/blog/public
|
||||
'';
|
||||
ExecStart = ''${pkgs.hugo}/bin/hugo --minify build -d /srv/blog/public'';
|
||||
User = "lomig";
|
||||
};
|
||||
environment = {
|
||||
PATH = lib.mkForce "${pkgs.git}/bin:${pkgs.hugo}/bin:${pkgs.openssh}/bin";
|
||||
};
|
||||
};
|
||||
systemd.timers.hugo-build = {
|
||||
description = "Timer pour rebuild du blog";
|
||||
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 = {
|
||||
enable = true;
|
||||
|
|
@ -43,4 +57,4 @@
|
|||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue