Skip to content

feat: 691 sso authentication #27

feat: 691 sso authentication

feat: 691 sso authentication #27

Workflow file for this run

name: Database
env:
DATABASE_URL: ${{ secrets.DATABASE_URL_STAGING }}
on:
push:
paths:
- '.github/workflows/database.yml'
- 'drizzle/**'
- 'src/database/**'
pull_request:
paths:
- '.github/workflows/database.yml'
- 'drizzle/**'
- 'src/database/**'
jobs:
migrate_test:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
services:
postgres:
image: postgres:16
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: sainseni_test
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 8.15.5
run_install: true
- name: Setup .env
env:
DATABASE_URL: 'postgres://postgres:postgres@localhost:5432/sainseni_test'
run: echo "DATABASE_URL=$DATABASE_URL" > $GITHUB_ENV
- name: Generate Database
run: |
pnpm db:generate
echo "Database Generated"
- name: Migrate Database
run: |
pnpm db:migrate
echo "Database Migrated"
- name: Seed Database
run: |
pnpm db:seed
echo "Database Seeded"
migrate_staging:
if: github.event_name == 'push' && !contains(github.ref, 'refs/tags/') && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- name: Skip
run: echo "Skipped"
- name: Checkout Repository
uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 8.15.5
run_install: true
- name: Setup .env
env:
DATABASE_URL: ${{ secrets.DATABASE_URL_STAGING }}
run: echo "DATABASE_URL=$DATABASE_URL" > $GITHUB_ENV
# NOTE: Delete this step if later
- name: Generate Database
run: |
pnpm db:generate
echo "Database Generated"
- name: Migrate Database
run: |
pnpm db:migrate
echo "Database Migrated"
# NOTE: Delete this step if later
- name: Seed Database
run: |
pnpm db:seed
echo "Database Seeded"
migrate_production:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- name: Skip
run: echo "Skipped"
- name: Checkout Repository
uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 8.15.5
run_install: true
- name: Migrate Database
run: |
pnpm db:migrate
echo "Database Migrated"