Skip to content

Commit

Permalink
build(database): deploy migrations in the ci
Browse files Browse the repository at this point in the history
  • Loading branch information
tericcabrel committed Jun 22, 2024
1 parent 7a26b7e commit 780be37
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/deploy-migration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
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

0 comments on commit 780be37

Please sign in to comment.