Skip to content

Commit

Permalink
Fix deploy script and cdn url
Browse files Browse the repository at this point in the history
  • Loading branch information
CharlesTaylor7 committed May 8, 2024
1 parent f9dc444 commit 5c415a5
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
4 changes: 2 additions & 2 deletions deploy.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set -e
set -eo pipefail

# load .env for supabase env vars
export $(cat .env | xargs)
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/templates/filters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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> {
Expand Down
8 changes: 8 additions & 0 deletions supabase/migrations/20240508_styles_bucket.sql
Original file line number Diff line number Diff line change
@@ -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;
6 changes: 0 additions & 6 deletions supabase/seed.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 5c415a5

Please sign in to comment.