Skip to content

Commit

Permalink
chore: rename dev supabase to prod
Browse files Browse the repository at this point in the history
  • Loading branch information
dOrgJelli committed Feb 20, 2024
1 parent 86d9697 commit 2849bed
Show file tree
Hide file tree
Showing 2 changed files with 116 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/cd.dev.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
name: CD Dev

"""
NOTE: temporarily disabled, need to make new dev environment
on:
push:
branches:
- release/dev
"""

jobs:
Deploy-API:
Expand Down
113 changes: 113 additions & 0 deletions .github/workflows/cd.prod.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
name: CD Prod

on:
push:
branches:
- release/prod

jobs:
Deploy-API:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Set up Python 3.10
uses: actions/setup-python@v2
with:
python-version: "3.10"

- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
- name: Read .nvmrc
run: echo ::set-output name=NVMRC::$(cat .nvmrc)
id: nvm
working-directory: ./workers

- name: Setup Node.js
uses: actions/setup-node@master
with:
node-version: '${{ steps.nvm.outputs.NVMRC }}'

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
working-directory: ./workers

- uses: actions/cache@v2
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: (yarn install --nonInteractive --frozen-lockfile --prefer-offline || yarn install --nonInteractive --frozen-lockfile --prefer-offline)
working-directory: ./workers

# TODO: rename to all "dev" here to prod and update aws accordingly
- name: Deploy
run: yarn deploy:dev
working-directory: ./workers
env:
DEPLOYMENT_STAGE: dev
AWS_ACCESS_KEY_ID: ${{ secrets.DEV_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.DEV_AWS_SECRET_ACCESS_KEY }}
DEV_INNGEST_SIGNING_KEY: ${{ secrets.DEV_INNGEST_SIGNING_KEY }}
DEV_INNGEST_EVENT_KEY: ${{ secrets.DEV_INNGEST_EVENT_KEY }}
DEV_NEXT_PUBLIC_SUPABASE_URL: ${{ secrets.PROD_NEXT_PUBLIC_SUPABASE_URL }}
DEV_NEXT_PUBLIC_SUPABASE_ANON_KEY: ${{ secrets.PROD_NEXT_PUBLIC_SUPABASE_ANON_KEY }}
DEV_SUPABASE_SERVICE_ROLE_KEY: ${{ secrets.PROD_SUPABASE_SERVICE_ROLE_KEY }}
DEV_OPENAI_API_KEY: ${{ secrets.DEV_OPENAI_API_KEY}}
DEV_PINECONE_API_KEY: ${{ secrets.DEV_PINECONE_API_KEY }}

Deploy-DB:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Read .nvmrc
run: echo ::set-output name=NVMRC::$(cat .nvmrc)
id: nvm

- name: Setup Node.js
uses: actions/setup-node@master
with:
node-version: '${{ steps.nvm.outputs.NVMRC }}'

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v2
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: cp ../yarn.lock ./ && (yarn install --nonInteractive --frozen-lockfile --prefer-offline || yarn install --nonInteractive --frozen-lockfile --prefer-offline)
working-directory: ./web

- uses: supabase/setup-cli@v1
with:
version: latest
- run: supabase link --project-ref $PROJECT_ID --password $DB_PASSWORD --debug
working-directory: ./web
env:
DB_PASSWORD: ${{ secrets.PROD_SUPABASE_DB_PASSWORD }}
PROJECT_ID: ${{ secrets.PROD_SUPABASE_PROJECT_ID }}
SUPABASE_ACCESS_TOKEN: ${{ secrets.DEV_SUPABASE_ACCESS_TOKEN }}

- run: supabase db push --password $DB_PASSWORD
working-directory: ./web
env:
DB_PASSWORD: ${{ secrets.PROD_SUPABASE_DB_PASSWORD }}
SUPABASE_ACCESS_TOKEN: ${{ secrets.DEV_SUPABASE_ACCESS_TOKEN }}

# TODO: update to api.fundpublicgoods.ai once updated in AWS
- run: curl -X PUT https://api.dev.fundpublicgoods.ai/api/inngest

0 comments on commit 2849bed

Please sign in to comment.