From 75baf9efb4f8e9a48bf11f5b2d90d4331bde5fa8 Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Wed, 5 Jun 2024 23:26:49 +0200 Subject: [PATCH] feat: add Taskfile and Lefthook to project --- .gitignore | 1 + flake.nix | 1 + taskfile.yaml | 16 ++++++++++++++-- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 90fdf0c..84df769 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ cache __pycache__ .direnv plugins +.env diff --git a/flake.nix b/flake.nix index 6c42ea1..e890607 100644 --- a/flake.nix +++ b/flake.nix @@ -55,6 +55,7 @@ python3Packages.typogrify python3Packages.livereload python3Packages.invoke + rsync ]; shellHook = '' mkdir -p plugins diff --git a/taskfile.yaml b/taskfile.yaml index b4790a8..2b9a41f 100644 --- a/taskfile.yaml +++ b/taskfile.yaml @@ -1,11 +1,23 @@ version: "3" set: [errexit, pipefail, nounset] shopt: [globstar] -tasks: +dotenv: + - .env +vars: + OUTPUT_PATH: ./output + DEPLOY_CMD: rsync + DEPLOY_ARGS: -avz --delete +tasks: build: cmds: - - pelican -o ./output + - pelican -o {{.OUTPUT_PATH}} serve: cmds: - invoke livereload + deploy: + deps: + - build + cmds: + - | + {{.DEPLOY_CMD}} {{.DEPLOY_ARGS}} {{.OUTPUT_PATH}} {{.HOSTNAME}}:{{.WWW_PATH}}