Skip to content

Commit

Permalink
Merge pull request #11 from ghost-in-the-machine-llc/supabase-edge-fn
Browse files Browse the repository at this point in the history
Testing new workflow on staging push
  • Loading branch information
martypdx committed Oct 31, 2023
2 parents baed77f + dc4e397 commit 69dcdea
Show file tree
Hide file tree
Showing 5 changed files with 101 additions and 26 deletions.
File renamed without changes.
26 changes: 0 additions & 26 deletions .github/workflows/deploy-production.yml

This file was deleted.

30 changes: 30 additions & 0 deletions .github/workflows/deploy-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Deploy Supabase

on:
workflow_call:
inputs:
project-id:
required: true
type: string
secrets:
token:
required: true
db-password:
required: true

jobs:
deploy-staging:
name: Setup & Deploy Supabase to Production
runs-on: ubuntu-latest
env:
SUPABASE_ACCESS_TOKEN: ${{ secrets.token }}
SUPABASE_DB_PASSWORD: ${{ secrets.db-password }}
SUPABASE_PROJECT_ID: ${{ inputs.project-id }}

steps:
- name: Log Info
run: |
echo "project: $SUPABASE_PROJECT_ID"
echo "token: $SUPABASE_ACCESS_TOKEN"
echo "db-pwd: $SUPABASE_ACCESS_TOKEN"
36 changes: 36 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Deploy Supabase

on:
workflow_call:
inputs:
project-id:
required: true
type: string
secrets:
token:
required: true
db-password:
required: true

jobs:
deploy-staging:
name: Setup & Deploy Supabase to Production
runs-on: ubuntu-latest
env:
SUPABASE_ACCESS_TOKEN: ${{ secrets.token }}
SUPABASE_DB_PASSWORD: ${{ secrets.db-password }}
SUPABASE_PROJECT_ID: ${{ inputs.project-id }}

steps:
- name: Log Project
run: echo "Deploying Supabase to $SUPABASE_PROJECT_ID"

- name: Checkout code
uses: actions/checkout@v3

- uses: supabase/setup-cli@v1
with:
version: latest

- name: Deploy Functions
run: supabase functions deploy --project-ref $SUPABASE_PROJECT_ID #this may work w/o flag
35 changes: 35 additions & 0 deletions .github/workflows/spiritwave-ai.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Spirit Wave AI

on: [push]

jobs:
run-ci:
name: Run CI
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Use Node.js 20
uses: actions/setup-node@v3
with:
node-version: 20

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

- run: npm ci
- run: npm run lint

deploy:
if: github.ref_name == 'staging'
name: Deploy to Staging
uses: "./.github/workflows/deploy-test.yml"
with:
project-id: ${{ vars.STAGING_SUPABASE_PROJECT_ID}}
secrets:
token: ${{ secrets.SUPABASE_ACCESS_TOKEN }}
db-password: ${{ secrets.STAGING_SUPABASE_DB_PASSWORD }}

0 comments on commit 69dcdea

Please sign in to comment.