-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update workflows for preview deployment and branch deletion
- Loading branch information
1 parent
0837fb8
commit fd07ad2
Showing
2 changed files
with
11 additions
and
10 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 |
---|---|---|
@@ -1,15 +1,19 @@ | ||
name: Clean up Neon Branch | ||
name: Clean up Preview Deployment | ||
on: | ||
pull_request: | ||
types: [closed] | ||
|
||
jobs: | ||
delete-neon-branch: | ||
delete-preview: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Delete Fly app | ||
id: deploy | ||
uses: superfly/[email protected] | ||
|
||
- name: Delete Neon Branch | ||
uses: neondatabase/[email protected] | ||
with: | ||
project_id: ${{ secrets.NEON_PROJECT_ID }} | ||
branch: preview/pr-${{ github.event.number }}-${{ github.event.pull_request.head.ref }} | ||
api_key: ${{ secrets.NEON_API_KEY }} | ||
api_key: ${{ secrets.NEON_API_KEY }} |
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,6 @@ | ||
name: Preview Deployment | ||
on: | ||
pull_request: | ||
types: [opened, reopened, synchronize, closed] | ||
|
||
on: [pull_request] | ||
|
||
env: | ||
NEON_DATABASE_USERNAME: ${{ secrets.NEON_DATABASE_USERNAME }} # change this to your database username | ||
GH_TOKEN: ${{ secrets.GH_TOKEN }} # Required for commenting on pull requests for private repos | ||
|
@@ -27,7 +25,7 @@ jobs: | |
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18 | ||
cache: 'pnpm' | ||
cache: "pnpm" | ||
- name: Install dependencies | ||
run: pnpm install | ||
|
||
|
@@ -59,12 +57,11 @@ jobs: | |
uses: superfly/[email protected] | ||
with: | ||
secrets: DATABASE_URL=${{ steps.create-branch.outputs.db_url }}?sslmode=require | ||
|
||
|
||
- name: Comment on Pull Request | ||
uses: thollander/actions-comment-pull-request@v2 | ||
with: | ||
# GITHUB_TOKEN: ${{ env.GH_TOKEN }} # Required for private repos | ||
message: | | ||
Fly Preview URL :balloon: : ${{ steps.deploy.outputs.url }} | ||
Neon branch :elephant: : https://console.neon.tech/app/projects/${{ secrets.NEON_PROJECT_ID }}/branches/${{ steps.create-branch.outputs.branch_id }} | ||
Neon branch :elephant: : https://console.neon.tech/app/projects/${{ secrets.NEON_PROJECT_ID }}/branches/${{ steps.create-branch.outputs.branch_id }} |