generated from warmachine028/github-super-starter-kit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3e182c6
commit 710d469
Showing
13 changed files
with
296 additions
and
28 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
name: Create/Delete Branch for Pull Request | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- reopened | ||
- synchronize | ||
- closed | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
|
||
jobs: | ||
setup: | ||
name: Setup | ||
outputs: | ||
branch: ${{ steps.branch_name.outputs.current_branch }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Get branch name | ||
id: branch_name | ||
uses: tj-actions/branch-names@v8 | ||
|
||
create_neon_branch: | ||
name: Create Neon Branch | ||
outputs: | ||
db_url: ${{ steps.create_neon_branch_encode.outputs.db_url }} | ||
db_url_with_pooler: ${{ steps.create_neon_branch_encode.outputs.db_url_with_pooler }} | ||
needs: setup | ||
if: | | ||
github.event_name == 'pull_request' && ( | ||
github.event.action == 'synchronize' | ||
|| github.event.action == 'opened' | ||
|| github.event.action == 'reopened') | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Create Neon Branch | ||
id: create_neon_branch | ||
uses: neondatabase/create-branch-action@v5 | ||
with: | ||
username: ${{ secrets.NEON_USERNAME }} | ||
branch_name: preview/pr-${{ github.event.number }}-${{ needs.setup.outputs.branch }} | ||
project_id: ${{ vars.NEON_PROJECT_ID }} | ||
api_key: ${{ secrets.NEON_API_KEY }} | ||
|
||
delete_neon_branch: | ||
name: Delete Neon Branch | ||
needs: setup | ||
if: github.event_name == 'pull_request' && github.event.action == 'closed' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Delete Neon Branch | ||
uses: neondatabase/delete-branch-action@v3 | ||
with: | ||
project_id: ${{ vars.NEON_PROJECT_ID }} | ||
branch: preview/pr-${{ github.event.number }}-${{ needs.setup.outputs.branch }} | ||
api_key: ${{ secrets.NEON_API_KEY }} | ||
|
||
reset_neon_branch: | ||
name: Reset Neon Branch | ||
needs: setup | ||
if: | | ||
contains(github.event.pull_request.labels.*.name, 'Reset Neon Branch') && | ||
github.event_name == 'pull_request' && | ||
(github.event.action == 'synchronize' || | ||
github.event.action == 'opened' || | ||
github.event.action == 'reopened' || | ||
github.event.action == 'labeled') | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Reset Neon Branch | ||
uses: neondatabase/reset-branch-action@v1 | ||
with: | ||
project_id: ${{ vars.NEON_PROJECT_ID }} | ||
parent: true | ||
branch: preview/pr-${{ github.event.number }}-${{ needs.setup.outputs.branch }} | ||
api_key: ${{ secrets.NEON_API_KEY }} | ||
|
||
# The step above creates a new Neon branch. | ||
# You may want to do something with the new branch, such as run migrations, run tests | ||
# on it, or send the connection details to a hosting platform environment. | ||
# The branch DATABASE_URL is available to you via: | ||
# "${{ steps.create_neon_branch.outputs.db_url_with_pooler }}". | ||
# It's important you don't log the DATABASE_URL as output as it contains a username and | ||
# password for your database. | ||
# For example, you can uncomment the lines below to run a database migration command: | ||
# - name: Run Migrations | ||
# run: npm run db:migrate | ||
# env: | ||
# # to use pooled connection | ||
# DATABASE_URL: "${{ steps.create_neon_branch.outputs.db_url_with_pooler }}" | ||
# # OR to use unpooled connection | ||
# # DATABASE_URL: "${{ steps.create_neon_branch.outputs.db_url }}" | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,18 @@ | ||
DUMMY_DATABASE_URL="postgresql://johndoe:randompassword@localhost:5432/mydb?schema=public" | ||
|
||
# Vercel | ||
POSTGRES_URL=<Your POSTGRES_URL> | ||
POSTGRES_PRISMA_URL=<Your POSTGRES_PRISMA_URL> | ||
POSTGRES_URL_NO_SSL=<Your POSTGRES_URL_NO_SSL> | ||
POSTGRES_URL_NON_POOLING=<Your POSTGRES_URL_NON_POOLING> | ||
POSTGRES_USER=<Your POSTGRES_USER> | ||
POSTGRES_HOST=<Your POSTGRES_HOST> | ||
POSTGRES_PASSWORD=<Your POSTGRES_PASSWORD> | ||
POSTGRES_DATABASE=<Your POSTGRES_DATABASE> | ||
POSTGRES_DATABASE=<Your POSTGRES_DATABASE> | ||
PULSE_API_KEY=<Your PULSE_API_KEY> | ||
|
||
# Neon | ||
DATABASE_URL=<Your DATABASE_URL> | ||
DATABASE_URL_UNPOOLED=<Your DATABASE_URL_UNPOOLED> | ||
ID=<Your ID> | ||
HOST=<Your HOST> |
Oops, something went wrong.