Skip to content

feat: use supabase for question comments #142

feat: use supabase for question comments

feat: use supabase for question comments #142

name: Deploy Fly PR Preview
on:
# Run this workflow on every PR event. Existing review apps will be updated when the PR is updated.
pull_request:
# Trigger when labels are changed or more commits added to a PR that contains labels
types: [labeled, synchronize]
# Only create a preview if changes have been made to the main src code or backend functions
paths:
- 'src/**'
- 'functions/**'
- 'packages/components/**'
- '.github/workflows/pr-preview.yml'
- 'package.json'
- 'yarn.lock'
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
# Set these to your Fly.io organization and preferred region.
FLY_REGION: ams
FLY_ORG: one-army
jobs:
preview_app:
if: contains(github.event.pull_request.labels.*.name, 'Review allow-preview ✅')
runs-on: ubuntu-latest
continue-on-error: true
outputs:
url: ${{ steps.deploy.outputs.url }}
# Only run one deployment at a time per PR.
concurrency:
group: pr-${{ github.event.number }}
# Deploying apps with this "review" environment allows the URL for the app to be displayed in the PR UI.
# Feel free to change the name of this environment.
environment:
name: preview
# The script in the `deploy` sets the URL output for each review app.
url: ${{ steps.deploy.outputs.url }}
env:
SUPABASE_ACCESS_TOKEN: ${{ secrets.SUPABASE_ACCESS_TOKEN }}
SUPABASE_DB_PASSWORD: ${{ secrets.PREVIEW_DB_PASSWORD }}
SUPABASE_PROJECT_ID: ${{ secrets.PREVIEW_PROJECT_ID }}
steps:
- name: Get code
uses: actions/checkout@v4
with:
# pull the repo from the pull request source, not the default local repo
ref: ${{ github.event.pull_request.head.sha }}
- name: Install supabase CLI
uses: supabase/setup-cli@v1
with:
version: latest
- name: Link Supabase project
run: supabase link --project-ref $SUPABASE_PROJECT_ID
- name: Push Supabase DB
run: supabase db push
- name: Deploy PR app to Fly.io
id: deploy
uses: superfly/[email protected]
with:
config: fly-preview.toml
name: community-platform-pr-${{ github.event.number }}
- name: Set Fly.io Secrets
env:
SUPABASE_API_URL: ${{ secrets.SUPABASE_API_URL }}
SUPABASE_KEY: ${{ secrets.SUPABASE_KEY }}
FIREBASE_PROJECT_ID: ${{ secrets.FIREBASE_PROJECT_ID }}
FIREBASE_PRIVATE_KEY: ${{ secrets.FIREBASE_PRIVATE_KEY }}
FIREBASE_CLIENT_EMAIL: ${{ secrets.FIREBASE_CLIENT_EMAIL }}
run: |
fly secrets set SUPABASE_API_URL=$SUPABASE_API_URL SUPABASE_KEY=$SUPABASE_KEY FIREBASE_PROJECT_ID=$FIREBASE_PROJECT_ID FIREBASE_PRIVATE_KEY=$FIREBASE_PRIVATE_KEY FIREBASE_CLIENT_EMAIL=$FIREBASE_CLIENT_EMAIL