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: 💿 Neon PR Branching | |
on: | |
pull_request: | |
types: [opened] | |
workflow_dispatch: | |
jobs: | |
create-neon-branch: | |
name: 🚀 Create Neon Database Branch | |
runs-on: ubuntu-latest | |
steps: | |
- name: Get branch name | |
id: branch-name | |
uses: tj-actions/branch-names@v7 | |
- name: Create neon branch | |
uses: neondatabase/create-branch-action@v4 | |
with: | |
project_id: ${{ secrets.NEON_PROJECT_ID }} | |
branch_name: ${{ steps.branch-name.outputs.current_branch }} | |
username: ${ secrets.PG_USERNAME }} | |
api_key: ${{ secrets.NEON_API_KEY }} | |
id: create-branch | |
- name: Create .env file | |
run: | | |
echo "DATABASE_URL=${{ steps.create-branch.outputs.db_url }}" >> .env | |
- name: Upload .env file as an artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: ${{ steps.branch-name.outputs.current_branch }}-env | |
path: apps/web/.env |