Skip to content

build(database): deploy migrations in the ci #1

build(database): deploy migrations in the ci

build(database): deploy migrations in the ci #1

name: Build and release project
on:
pull_request: # TODO to be removed
branches:
- 'main'
push:
branches:
- 'main'
- 'dev'
paths:
- 'packages/domain/prisma/migrations/**'
jobs:
deploy-migration:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup pscale
uses: planetscale/setup-pscale-action@v1
- name: Set database branch name
env:
PLANETSCALE_SERVICE_TOKEN_ID: ${{ secrets.PLANETSCALE_SERVICE_TOKEN_ID }}
PLANETSCALE_SERVICE_TOKEN: ${{ secrets.PLANETSCALE_SERVICE_TOKEN }}
run: echo "PSCALE_BRANCH_NAME=$(echo ${{ github.head_ref }} | tr -cd '[:alnum:]-'| tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV