fix(deps): update dependency zustand to v4.5.2 #235
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Pscale & Vercel - merge DR and production deployment on PR merge | |
on: | |
pull_request: | |
types: | |
- closed | |
workflow_dispatch: | |
env: | |
PLANETSCALE_SERVICE_TOKEN_ID: ${{ secrets.PLANETSCALE_SERVICE_TOKEN_ID }} | |
PLANETSCALE_SERVICE_TOKEN: ${{ secrets.PLANETSCALE_SERVICE_TOKEN }} | |
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} | |
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} | |
DEPLOY_SUCCESS_STATUS: "complete_pending_revert" | |
jobs: | |
deploy-db: | |
if: github.event_name == 'workflow_dispatch' || github.event.pull_request.merged == true | |
name: Deploy DB changes | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set DB branch name | |
run: echo "PSCALE_BRANCH_NAME=$(echo ${{ github.head_ref }} | tr -cd '[:alnum:]-'| tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV | |
- name: Setup pscale | |
uses: planetscale/setup-pscale-action@v1 | |
- name: Get Deploy Requests number from branch name | |
run: | | |
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') | |
echo "DEPLOY_REQUEST_NUMBER=$deploy_request_number" >> $GITHUB_ENV | |
- name: Deploy schema migrations | |
if: ${{ env.DEPLOY_REQUEST_NUMBER }} | |
run: | | |
pscale deploy-request deploy ${{ secrets.PLANETSCALE_DATABASE_NAME }} ${{ env.DEPLOY_REQUEST_NUMBER }} --org ${{ secrets.PLANETSCALE_ORG_NAME }} --wait | |
- name: Check deploy result | |
if: ${{ env.DEPLOY_REQUEST_NUMBER }} | |
run: | | |
deploy_request_status=$(pscale deploy-request show ${{ secrets.PLANETSCALE_DATABASE_NAME }} ${{ env.DEPLOY_REQUEST_NUMBER }} --org ${{ secrets.PLANETSCALE_ORG_NAME }} -f json | jq -r '.deployment.state') | |
if [ "$deploy_request_status" == "${{env.DEPLOY_SUCCESS_STATUS}}" ]; then | |
echo "Deployed successfully" | |
echo "DEPLOY_SUCCESS=true" >> $GITHUB_ENV; | |
exit 0 | |
else | |
echo "Deployment failed" | |
exit 1 | |
fi | |
- name: skip revert DR | |
if: ${{ env.DEPLOY_SUCCESS }} | |
run: | | |
pscale dr skip-revert ${{ secrets.PLANETSCALE_DATABASE_NAME }} ${{ env.DEPLOY_REQUEST_NUMBER }} --org ${{ secrets.PLANETSCALE_ORG_NAME }} | |
- name: Delete merged branch | |
if: ${{ env.DEPLOY_SUCCESS }} | |
run: | | |
pscale branch delete ${{ secrets.PLANETSCALE_DATABASE_NAME }} ${{ env.PSCALE_BRANCH_NAME }} --org ${{ secrets.PLANETSCALE_ORG_NAME }} --force | |
deploy-code: | |
runs-on: ubuntu-latest | |
# I want to deploy on PR merge, after waiting for DB migration to finish. Even if no DB migration to deploy, dependency job correctly runs. | |
needs: deploy-db | |
name: Deploy code | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
- name: Install Vercel CLI | |
run: npm install --global vercel@latest | |
- name: Deploy to Vercel | |
run: vercel deploy --prod --token=${{ secrets.VERCEL_TOKEN }} |