From 6014a89b8fc70c202142f656429025bf79e057bc Mon Sep 17 00:00:00 2001 From: Joachim Breitner Date: Tue, 12 Apr 2022 08:58:31 +0200 Subject: [PATCH] Add a netlify build script --- .netlify.sh | 19 +++++++++++++++++++ netlify.toml | 3 +++ 2 files changed, 22 insertions(+) create mode 100755 .netlify.sh create mode 100644 netlify.toml diff --git a/.netlify.sh b/.netlify.sh new file mode 100755 index 000000000..d91fcfdb3 --- /dev/null +++ b/.netlify.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash + +# +# Deploy a preview of the interface specification to netlify +# + +set -e + +export NP_GIT=$(which git) + +wget -nv https://github.com/DavHau/nix-portable/releases/download/v009/nix-portable +chmod +x nix-portable + +./nix-portable nix-build -A interface-spec default.nix + +# The "result" symlink only valid inside the nix-portable sandbox, so use nix-shell +./nix-portable nix-shell -p bash --run "cp -rL result/spec/ _netlify-deploy" + +chmod -R u+w _netlify-deploy diff --git a/netlify.toml b/netlify.toml new file mode 100644 index 000000000..1d4a4ec08 --- /dev/null +++ b/netlify.toml @@ -0,0 +1,3 @@ +[build] + command = "./.netlify.sh" + publish = "_netlify-deploy"