Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
fforres committed Nov 22, 2024
1 parent 799689d commit c48dae7
Show file tree
Hide file tree
Showing 6 changed files with 296 additions and 80 deletions.
1 change: 1 addition & 0 deletions .github/workflows/lint_and_typecheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- main
- release
pull_request:

jobs:
Expand Down
53 changes: 53 additions & 0 deletions .github/workflows/publish-site.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Deploy website

on:
workflow_run:
# Esto tiene q hacer match con los nombres de los workflows de tests
workflows: ["Lint and Typecheck"]
branches: [main, release]
types:
- completed

jobs:
publish:
# if: ${{ github.event.workflow_run.conclusion == 'success' }}
name: Publish website to Cloudflare Workers
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write
env:
ENVIRONMENT: ${{ github.event.workflow_run.head_branch == 'release' && 'production' || github.event.workflow_run.head_branch == 'main' && 'staging' || 'dev' }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
steps:
- name: ⏳ Cloning repo
uses: actions/checkout@v4
with:
show-progress: false

- name: 📦 Download Cached Package Dependencies
uses: actions/cache@v3
env:
cache-name: NPM
with:
path: ~/.npm
key: CACHE-${{ env.cache-name }}-${{ hashFiles('package-lock.json') }}

- name: ⬢ Setup Node
uses: actions/setup-node@v4
with:
node-version: 22
cache: "npm"

- name: 📥 Install dependencies
run: npm ci --prefer-offline --no-audit --legacy-peer-deps --cache ~/.npm

- name: Build project
run: BUILD_ENV=${{ env.ENVIRONMENT }} npm run build

- name: Deploy
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
packageManager: npm
command: deploy --env ${{ env.ENVIRONMENT }} --minify
16 changes: 8 additions & 8 deletions app/utils/supabase/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
import { createClient } from "@supabase/supabase-js";
import { CookieAttributes } from "node_modules/@types/js-cookie";

if (!import.meta.env.VITE_SUPABASE_URL) {
throw new Error("Missing VITE_SUPABASE_URL");
}
// if (!import.meta.env.VITE_SUPABASE_URL) {
// throw new Error("Missing VITE_SUPABASE_URL");
// }

if (!import.meta.env.VITE_SUPABASE_ANON_KEY) {
throw new Error("Missing VITE_SUPABASE_ANON_KEY");
}
// if (!import.meta.env.VITE_SUPABASE_ANON_KEY) {
// throw new Error("Missing VITE_SUPABASE_ANON_KEY");
// }

export const supabaseClient = createClient(
import.meta.env.VITE_SUPABASE_URL,
import.meta.env.VITE_SUPABASE_ANON_KEY,
import.meta.env.VITE_SUPABASE_URL!,
import.meta.env.VITE_SUPABASE_ANON_KEY!,
);

const oneHour = 1000 * 60 * 60;
Expand Down
Loading

0 comments on commit c48dae7

Please sign in to comment.