about summary refs log tree commit diff stats
path: root/justfile
diff options
context:
space:
mode:
authorAlan Pearce2024-06-22 16:07:12 +0200
committerAlan Pearce2024-06-22 19:18:24 +0200
commita049c9cc6b11018e7fc497876ad0402965d87397 (patch)
tree299060da298be0bdf8ea57e3c12f4de7260683a6 /justfile
parent0fd65e3f27d6765983656c164b650fc7047ae03e (diff)
downloadwebsite-a049c9cc6b11018e7fc497876ad0402965d87397.tar.lz
website-a049c9cc6b11018e7fc497876ad0402965d87397.tar.zst
website-a049c9cc6b11018e7fc497876ad0402965d87397.zip
add CD to fly
Diffstat (limited to 'justfile')
-rwxr-xr-xjustfile15
1 files changed, 13 insertions, 2 deletions
diff --git a/justfile b/justfile
index 8b2922c..08f6b01 100755
--- a/justfile
+++ b/justfile
@@ -1,5 +1,8 @@
-#! /usr/bin/env nix-shell
-#! nix-shell -i "just --justfile"
+#!/usr/bin/env nix-shell
+#!nix-shell -i "just --justfile"
+
+docker-registry := "registry.fly.io/alanpearce-eu"
+docker-tag := `date +%Y%m%d%H%M%S`
 
 default:
 	@just --list --justfile {{ justfile() }} --unsorted
@@ -27,6 +30,14 @@ dev:
 
 ci: build check-links
 
+cd:
+	fly auth docker
+	nix-build -A docker-stream-amd64-linux | sh | gzip --fast | \
+		skopeo copy --dest-precompute-digests \
+			docker-archive:/dev/stdin \
+			docker://{{ docker-registry }}:{{ docker-tag }}
+	fly deploy --image {{ docker-registry }}:{{ docker-tag }}
+
 deploy-vercel-preview: build
 	vercel pull --environment=preview
 	vercel deploy