Skip to content

[MAPA-600] Add mongodb #100

[MAPA-600] Add mongodb

[MAPA-600] Add mongodb #100

Workflow file for this run

name: Prisma Migrate
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
workflow_dispatch:
pull_request:
branches:
- '**'
paths:
- 'postgres/migrations/**'
push:
branches:
- 'main'
paths:
- 'postgres/migrations/**'
env:
LOCAL_DATABASE_URL: postgresql://user:password@localhost:5432/mapa
jobs:
deploy-mapa:
runs-on: ubuntu-latest
timeout-minutes: 5
environment:
name: ${{ github.ref == 'refs/heads/main' && 'production' || 'staging' }}
strategy:
matrix:
node-version: [18.x]
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Apply all pending migrations to the database
run: npm run migrate:deploy
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
- name: Push changes to the database monogodb
run: npm run mongodb:push
env:
MONGO_DB_URL: ${{ github.ref == 'refs/heads/main' && secrets.PROD_MONGO_DB_URL || secrets.STG_MONGO_DB_URL }}