Skip to content

Commit

Permalink
build: print branch name
Browse files Browse the repository at this point in the history
  • Loading branch information
tericcabrel committed Jun 22, 2024
1 parent 780be37 commit fbc3967
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions .github/workflows/deploy-migration.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
name: Build and release project
name: Deploy database migration
on:
pull_request: # TODO to be removed
branches:
- 'main'
paths:
- 'packages/domain/prisma/migrations/**'
push:
branches:
- 'main'
Expand All @@ -11,7 +13,7 @@ on:
- 'packages/domain/prisma/migrations/**'

jobs:
deploy-migration:
apply-migration:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -20,8 +22,14 @@ jobs:
uses: planetscale/setup-pscale-action@v1

- name: Set database branch name
run: echo "PSCALE_BRANCH_NAME=$(echo ${{ github.head_ref }} | tr -cd '[:alnum:]-'| tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV

- name: Apply migration
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
run: |
echo "$PSCALE_BRANCH_NAME"
echo "what is this"
echo "${{ env.PSCALE_BRANCH_NAME }}"

0 comments on commit fbc3967

Please sign in to comment.