Skip to content

[MAPA-149] feat: uses lambda-pedido-acolhimento migrations to track mapa's database @ BONDE infra #16

[MAPA-149] feat: uses lambda-pedido-acolhimento migrations to track mapa's database @ BONDE infra

[MAPA-149] feat: uses lambda-pedido-acolhimento migrations to track mapa's database @ BONDE infra #16

Workflow file for this run

name: Prisma Migrate
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
pull_request:
branches:
- '**'
paths:
- 'migrations/**'
push:
branches:
- 'main'
paths:
- 'migrations/**'
env:
LOCAL_DATABASE_URL: postgresql://user:password@localhost:5432/mapa
jobs:
deploy:
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.BONDE_DATABASE_URL }}