all repos — homestead @ 75a2aeaa84dfb047cc3f8282b37c5331e04c9828

Code for my website

deploy locally with just to vercel

Alan Pearce
commit

75a2aeaa84dfb047cc3f8282b37c5331e04c9828

parent

d7d891de66b9b494e4aea3bbac7f4e94110110c8

4 files changed, 20 insertions(+), 57 deletions(-)

jump to
M flake.nixflake.nix
@@ -45,6 +45,7 @@ gotools
go-tools gomod2nix.packages.${system}.default gci + hyperlink nodePackages.vercel netlify-cli sentry-cli
M justfilejustfile
@@ -3,19 +3,24 @@
fly-system := "x86_64-linux" fly-registry := "registry.fly.io/alanpearce-eu" docker-tag := env_var_or_default("DOCKER_TAG", `date +%Y%m%d%H%M%S` + "-" + `git rev-parse --short HEAD`) -version := `sentry-cli releases propose-version` environment := "production" started-at := `date +%s` default: @just --list --justfile {{ justfile() }} --unsorted +clean: + rm -r website + check: nix flake check . --print-build-logs check-licenses: nix run nixpkgs#go-licenses check ./... +check-links: + hyperlink website/public + update-all: go get -u all gomod2nix --outdir nix
@@ -26,8 +31,8 @@ watchexec --restart -w flake.nix -w flake.lock direnv exec . {{ command }}
watch-builder: (watch-flake "watchexec -w cmd/build -w content -w templates -r go run ./cmd/build --base-url http://localhost:3000") -generate: - go run ./cmd/build --base-url http://localhost:3000 +build: + go run ./cmd/build nix-build what: nix build .#{{ what }}
@@ -62,21 +67,21 @@
print-docker-tag: @echo {{ fly-registry }}:{{ docker-tag }} -stream-to-registry : sentry-create-release && sentry-finalise-release +stream-to-registry : just docker-stream-fly | gzip --fast | skopeo copy --dest-precompute-digests docker-archive:/dev/stdin docker://{{ fly-registry }}:{{ docker-tag }} -push-to-registry: sentry-create-release && sentry-finalise-release +push-to-registry: skopeo copy --dest-precompute-digests docker-archive://`readlink -f result` docker://{{ fly-registry }}:{{ docker-tag }} -sentry-create-release: - sentry-cli releases new {{ version }} +deploy-fly registry-and-tag=(fly-registry + ":" + docker-tag): + fly deploy --image {{ registry-and-tag }} -sentry-finalise-release: - sentry-cli releases set-commits {{ version }} --ignore-missing --auto # will not work in CI - sentry-cli releases finalize {{ version }} +deploy-vercel-preview: clean build + vercel pull --environment=preview + vercel deploy -sentry-create-deploy: - sentry-cli releases deploys {{ version }} new --started {{ started-at }} --finished `date +%s` --env {{ environment }} +deploy-vercel: clean build check-links + vercel pull --environment=production + vercel deploy --prod -deploy registry-and-tag=(fly-registry + ":" + docker-tag): && sentry-create-deploy - fly deploy --image {{ registry-and-tag }} +deploy-production: deploy-vercel
D netlify.toml
@@ -1,29 +0,0 @@
-[build] - publish = "website/public" - -[[headers]] - for = "/*" - [headers.values] - x-content-type-options = "nosniff" - x-xss-protection = "1; mode=block" - referrer-policy = "strict-origin-when-cross-origin" - strict-transport-security = "max-age=63072000; includeSubDomains; preload" - cache-control = ''' - max-age=300, - s-maxage=86400, - state-while-revalidate - ''' - content-security-policy = ''' - default-src 'none'; - img-src 'self' https://gc.zgo.at; - object-src 'none'; - script-src 'self' https://gc.zgo.at; - style-src - 'sha256-a4TPKWHB0aSu7cV10GthTEySTJ0w4r0bw6Q8JsNYMbk=' - 'sha256-gyxzfgCOxeAAL8URUdaW2nHYDOr9bzbwFjgSqi7D+8U='; - form-action 'none'; - base-uri 'self'; - connect-src https://alanpearce-eu.goatcounter.com/count; - frame-ancestors 'https://kagi.com'; - require-trusted-types-for "'script'" -'''
D netlify/netlify.toml
@@ -1,14 +0,0 @@
-[build] - base = "netlify" - publish = "." - -[[redirects]] - from = "*" - to = "https://alanpearce.eu/:splat" - status = 301 - force = true - -[[headers]] - for = "/*" - [headers.values] - cache-control = "max-age=86400"