Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: apply migration
Browse files Browse the repository at this point in the history
tericcabrel committed Jun 22, 2024
1 parent fe04534 commit 517690f
Showing 2 changed files with 8 additions and 8 deletions.
1 change: 1 addition & 0 deletions .github/workflows/migration-db-check.yml
Original file line number Diff line number Diff line change
@@ -12,6 +12,7 @@ env:

jobs:
migration-detail:
if: github.ref == 'refs/heads/main' #FIXME: to be removed
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
15 changes: 7 additions & 8 deletions .github/workflows/migration-db-deploy.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
name: Deploy database migration
on:
# pull_request: # TODO to be removed
# branches:
# - 'main'
# paths:
# - 'packages/domain/prisma/migrations/**'
pull_request: # TODO to be removed
branches:
- 'main'
paths:
- 'packages/domain/prisma/migrations/**'
push:
branches:
- 'main'
- 'dev'
paths:
- 'packages/domain/prisma/migrations/**'

@@ -39,7 +38,7 @@ jobs:
PLANETSCALE_SERVICE_TOKEN: ${{ secrets.PLANETSCALE_SERVICE_TOKEN }}
run: |
for i in {1..10}; do
DEPLOYMENT_STATE=$(pscale deploy-request show ${{ secrets.PLANETSCALE_DATABASE_NAME }} ${{ env.DEV_DEPLOY_REQUEST_NUMBER }} --org ${{ secrets.PLANETSCALE_ORG_NAME }} --format json | jq -r '.deployment_state')
DEPLOYMENT_STATE=$(pscale deploy-request show ${{ secrets.PLANETSCALE_DATABASE_NAME }} ${{ env.DEV_DEPLOY_REQUEST_NUMBER }} --org ${{ secrets.PLANETSCALE_ORG_NAME }} -f json | jq -r '.deployment_state')
echo "Deployment State: $DEPLOYMENT_STATE"
if [ "$DEPLOYMENT_STATE" = "ready" ]; then
@@ -74,7 +73,7 @@ jobs:
PROD_DEPLOY_REQUEST_NUMBER=$(pscale deploy-request show ${{ secrets.PLANETSCALE_DATABASE_NAME }} ${{ env.PSCALE_BRANCH_NAME }} --org ${{ secrets.PLANETSCALE_ORG_NAME }} -f json | jq -r '.number')
for i in {1..10}; do
DEPLOYMENT_STATE=$(pscale deploy-request show ${{ secrets.PLANETSCALE_DATABASE_NAME }} $PROD_DEPLOY_REQUEST_NUMBER --org ${{ secrets.PLANETSCALE_ORG_NAME }} --format json | jq -r '.deployment_state')
DEPLOYMENT_STATE=$(pscale deploy-request show ${{ secrets.PLANETSCALE_DATABASE_NAME }} $PROD_DEPLOY_REQUEST_NUMBER --org ${{ secrets.PLANETSCALE_ORG_NAME }} -f json | jq -r '.deployment_state')
echo "Deployment State: $DEPLOYMENT_STATE"
if [ "$DEPLOYMENT_STATE" = "ready" ]; then

0 comments on commit 517690f

Please sign in to comment.