diff --git a/.github/workflows/deploy-migration.yml b/.github/workflows/deploy-migration.yml new file mode 100644 index 00000000..380e3ff2 --- /dev/null +++ b/.github/workflows/deploy-migration.yml @@ -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 +