GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||
GeezerVison is showing github.com — Create Prisma Postgres Database - GitHub Marketplace A GitHub Action to create Prisma Postgres databases in your CI/CD workflows. - name: Create Database id: create uses: prisma/create-prisma-postgres-database-action@v1 with: service_token: ${{ secrets.PRISMA_POSTGRES_SERVICE_TOKEN }} project_id: ${{ secrets.PRISMA_PROJECT_ID }} - name: Use Database env: DATABASE_URL: ${{ steps.create.outputs.database_url }} run: | echo "Database ready: ${{ steps.create.outputs.database_name }}" # Use the DATABASE_URL in your application - name: Create Database uses: prisma/create-prisma-postgres-database-action@v1 with: service_token: ${{ secrets.PRISMA_POSTGRES_SERVICE_TOKEN }} project_id: ${{ secrets.PRISMA_PROJECT_ID }} database_name: "my-test-db" name: Prisma Postgres Database Lifecycle on: pull_request: types: [opened, reopened, synchronize, closed] jobs: create-database: name: Create Database if: github.event.action != 'closed' runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v4 - name: Create Database id: create uses: prisma/create-prisma-postgres-database-action@v1 with: service_token: ${{ secrets.PRISMA_POSTGRES_SERVICE_TOKEN }} project_id: ${{ secrets.PRISMA_PROJECT_ID }} database_name: "pr-${{ github.event.pull_request.number }}" - name: Verify database creation run: | echo "✅ Database created successfully!" echo "Database ID: ${{ steps.create.outputs.database_id }}" echo "Database Name: ${{ steps.create.outputs.database_name }}" echo "Database URL is available in steps.create.outputs.database_url" cleanup-database: name: Cleanup Database if: always() && github.event.action == 'closed' runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v4 - name: Delete Database id: delete uses: prisma/delete-prisma-postgres-database-action@v1 with: service_token: ${{ secrets.PRISMA_POSTGRES_SERVICE_TOKEN }} project_id: ${{ secrets.PRISMA_PROJECT_ID }} database_name: "pr-${{ github.event.pull_request.number }}" - name: Verify database deletion run: | if [ "${{ steps.delete.outputs.deleted }}" == "true" ]; then echo "✅ Database ${{ steps.delete.outputs.database_name }} was deleted" else echo "ℹ️ No database found to delete" fi
To avoid conflicts with your development databases, create a dedicated project specifically for CI workflows. Use the following curl command to create a new Prisma Postgres project: curl -X POST https://api.prisma.io/v1/projects \ -H "Authorization: Bearer $PRISMA_POSTGRES_SERVICE_TOKEN" \ -H "Content-Type: application/json" \ -d "{\"region\": \"us-west-1\", \"name\": \"$PROJECT_NAME\"}" Note the project ID from the response. Go to your repository settings → Secrets and variables → Actions, and add:
Add the action to your workflow as shown in the examples above. Auto-generated names:
This action only provisions the database and provides a connection string. You can use it with any database tool: - name: Setup with Prisma env: DATABASE_URL: ${{ steps.provision.outputs.database_url }} run: | npx prisma generate npx prisma db push
For issues and questions: Apache License - see LICENSE file for details. Create Prisma Postgres Database is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation. VerifiedTags2 (2)Create Prisma Postgres Database is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation. | ||||||||||||||||||||||||||||
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |