From 5c415a50f6e5dddc8ada865c390e08425464f3b3 Mon Sep 17 00:00:00 2001 From: Charles Taylor Date: Wed, 8 May 2024 10:45:09 -0400 Subject: [PATCH] Fix deploy script and cdn url --- deploy.sh | 4 ++-- src/templates/filters.rs | 2 +- supabase/migrations/20240508_styles_bucket.sql | 8 ++++++++ supabase/seed.sql | 6 ------ 4 files changed, 11 insertions(+), 9 deletions(-) create mode 100644 supabase/migrations/20240508_styles_bucket.sql diff --git a/deploy.sh b/deploy.sh index 43100fb..d963570 100755 --- a/deploy.sh +++ b/deploy.sh @@ -1,4 +1,4 @@ -set -e +set -eo pipefail # load .env for supabase env vars export $(cat .env | xargs) @@ -10,7 +10,7 @@ NODE_PATH=/opt/homebrew/lib/node_modules tailwindcss --input tailwind.source.css # supabase db push # upload stylesheet to supabase cdn -supabase storage --experimental rm ss:///styles/index.css +yes y | supabase storage --experimental rm ss:///styles/index.css || true supabase storage --experimental cp styles/index.css ss:///styles/index.css # deploy to citadels.fly.dev diff --git a/src/templates/filters.rs b/src/templates/filters.rs index 0973c5e..7b41957 100644 --- a/src/templates/filters.rs +++ b/src/templates/filters.rs @@ -10,7 +10,7 @@ pub fn stylesheet(_: &()) -> askama::Result<&'static str> { if cfg!(feature = "dev") { Ok("/styles/index.css") } else { - Ok("/") + Ok("https://ryvsflpspddwwacxrnst.supabase.co/storage/v1/object/public/styles/index.css") } } pub fn class(item: &ActionTag) -> askama::Result<&'static str> { diff --git a/supabase/migrations/20240508_styles_bucket.sql b/supabase/migrations/20240508_styles_bucket.sql new file mode 100644 index 0000000..4b0df0b --- /dev/null +++ b/supabase/migrations/20240508_styles_bucket.sql @@ -0,0 +1,8 @@ +-- storage setup -- +insert into "storage"."buckets"("id", "name", "public", "allowed_mime_types") +values ('styles', 'styles', true, NULL) +on conflict ("id") +do update set + "name" = excluded.name, + "public" = excluded.public, + "allowed_mime_types" = excluded.allowed_mime_types; diff --git a/supabase/seed.sql b/supabase/seed.sql index 22cb9af..bd5a29b 100644 --- a/supabase/seed.sql +++ b/supabase/seed.sql @@ -36,12 +36,6 @@ ALTER DEFAULT PRIVILEGES FOR ROLE "postgres" IN SCHEMA "public" GRANT ALL ON TAB ALTER DEFAULT PRIVILEGES FOR ROLE "postgres" IN SCHEMA "public" GRANT ALL ON TABLES TO "service_role"; RESET ALL; --- storage setup -- -insert into "storage"."buckets"("id", "name", "public", "allowed_mime_types") - ("styles", "styles", true, '{"text/css"}') -values -on conflict do nothing; - -- application tables -- create table "public"."games" ( "id" bigint generated by default as identity not null,