Move publish script to Nix

Signed-off-by: Oliver Davies <oliver@oliverdavies.uk>
This commit is contained in:
Oliver Davies 2025-08-25 18:20:11 +01:00
parent b4a233a20f
commit 386c68813a
3 changed files with 15 additions and 9 deletions

View file

@ -20,6 +20,7 @@
(import ../drafts.nix { inherit pkgs; })
(import ../new-draft.nix { inherit pkgs; })
(import ../publish.nix { inherit pkgs; })
];
};
}

14
publish.nix Normal file
View file

@ -0,0 +1,14 @@
{ pkgs }:
pkgs.writeShellApplication {
name = "publish";
runtimeInputs = with pkgs; [ rsync php ];
text = ''
vendor/bin/sculpin generate --env prod
rsync -uvrP static/ output_prod "$@"
rsync -uvrP output_prod/ nixedo.oliverdavies.uk:/var/www/vhosts/website-sculpin "$@"
'';
}

View file

@ -1,9 +0,0 @@
#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o pipefail
vendor/bin/sculpin generate --env prod
rsync -uvrP static/ output_prod "$@"
rsync -uvrP output_prod/ nixedo.oliverdavies.uk:/var/www/vhosts/website-sculpin "$@"