summaryrefslogtreecommitdiff
path: root/.scripts.d/30-publish.sh
diff options
context:
space:
mode:
Diffstat (limited to '.scripts.d/30-publish.sh')
-rw-r--r--.scripts.d/30-publish.sh21
1 files changed, 21 insertions, 0 deletions
diff --git a/.scripts.d/30-publish.sh b/.scripts.d/30-publish.sh
new file mode 100644
index 0000000..2bf49fa
--- /dev/null
+++ b/.scripts.d/30-publish.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+# vim: ai:ts=8:sw=8:noet
+set -EeufCo pipefail
+export SHELLOPTS # propagate set to children by default
+IFS=$'\t\n'
+
+# check required commands are in place
+command -v docker >/dev/null 2>&1 || {
+ echo 'please install docker-client'
+ exit 1
+}
+
+docker run --rm \
+ -v "$(pwd)/public":/public \
+ -w /public \
+ -e CLOUDFLARE_API_TOKEN="${CLOUDFLARE_API_TOKEN}" \
+ node:lts-slim \
+ bash -c '\
+ npm install -g wrangler && \
+ wrangler pages deploy . --project-name check-caps-lock
+ '