Skip to content

Commit

Permalink
chore: migrate to vercel+supabase edge
Browse files Browse the repository at this point in the history
  • Loading branch information
Vexcited committed Aug 12, 2023
1 parent a30e165 commit 36dbf44
Show file tree
Hide file tree
Showing 14 changed files with 353 additions and 130 deletions.
53 changes: 21 additions & 32 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,44 +1,33 @@
name: Deploy

on:
workflow_dispatch:
push:
branches: main
pull_request:
branches: main
branches:
- main

jobs:
deploy:
name: Deploy
name: Deploy to Vercel & Supabase
runs-on: ubuntu-latest

permissions:
id-token: write # Needed for auth with Deno Deploy
contents: read # Needed to clone the repository
env:
SUPABASE_ACCESS_TOKEN: ${{ secrets.SUPABASE_ACCESS_TOKEN }}
PROJECT_ID: ${{ secrets.SUPABASE_PROJECT_ID }}

steps:
- name: Clone repository
uses: actions/checkout@v3

- uses: pnpm/action-setup@v2
with:
version: 8

- name: Install Deno
uses: denoland/setup-deno@v1
with:
deno-version: v1.x

- name: Install Node.js
uses: actions/setup-node@v3
steps:
- uses: actions/checkout@v3
- uses: amondnet/vercel-action@v25
with:
node-version: lts/*
cache: 'pnpm'

- name: Build step
run: "pnpm install && pnpm build"

- name: Upload to Deno Deploy
uses: denoland/deployctl@v1
vercel-token: ${{ secrets.VERCEL_TOKEN }}
github-token: ${{ secrets.GITHUB_TOKEN }}
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
vercel-args: "--prod"
github-comment: false
- uses: supabase/setup-cli@v1
with:
project: "drive-cattolabs"
entrypoint: "server.js"
root: "dist"
version: latest

- run: supabase functions deploy --project-ref $PROJECT_ID
1 change: 1 addition & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"recommendations": [
"dbaeumer.vscode-eslint",
"denoland.vscode-deno",
"antfu.unocss"
]
}
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
"editor.insertSpaces": true,
"editor.tabSize": 2,

"deno.enablePaths": ["./supabase/functions"],
"deno.importMap": "./supabase/functions/import_map.json",

"cSpell.language": "en",
"cSpell.words": [
"catto",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"@types/mime-types": "^2.1.1",
"@unocss/preset-rem-to-px": "^0.54.2",
"@unocss/transformer-variant-group": "^0.54.2",
"solid-start-deno": "^0.3.2",
"solid-start-vercel": "^0.2.30",
"supabase": "^1.83.7",
"typescript": "^4.9.4",
"unocss": "^0.54.2",
"unocss-catppuccin": "^0.2.0",
Expand Down
120 changes: 99 additions & 21 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { setAuth } from "@/stores/auth";

export default function Root() {
onMount(async () => {
window.sb = supabase;
const { data } = await supabase.auth.getSession();
if (data.session) {
const user_profile = await getProfileWithSession(data.session);
Expand Down
Loading

0 comments on commit 36dbf44

Please sign in to comment.