Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update README.md #14

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,36 +50,36 @@ In that job it consists of the following steps:
group: pr-${{ github.event.number }}
```

1. Check out the codebase using [`actions/checkout@v4`](https://github.com/marketplace/actions/checkout).
2. Check out the codebase using [`actions/checkout@v4`](https://github.com/marketplace/actions/checkout).
```yaml
- uses: actions/checkout@v4
```
1. Sets up PNPM with [`pnpm/action-setup@v2`](https://github.com/marketplace/actions/setup-pnpm). (You can use another package manager depending on your setup.)
3. Sets up PNPM with [`pnpm/action-setup@v2`](https://github.com/marketplace/actions/setup-pnpm). (You can use another package manager depending on your setup.)
```yaml
- uses: pnpm/action-setup@v2
with:
version: 8
```
1. Configures Node.js version with caching for PNPM via `actions/setup-node@v4`.
4. Configures Node.js version with caching for PNPM via `actions/setup-node@v4`.
```yaml
- name: Use Node.js 18
uses: actions/setup-node@v4
with:
node-version: 18
cache: "pnpm"
```
1. Installs dependencies using `pnpm install`.
5. Installs dependencies using `pnpm install`.
```yaml
- name: Install dependencies
run: pnpm install
```
1. Retrieves and normalizes the branch name using [`tj-actions/branch-names@v8`](https://github.com/marketplace/actions/branch-names).
6. Retrieves and normalizes the branch name using [`tj-actions/branch-names@v8`](https://github.com/marketplace/actions/branch-names).
```yaml
- name: Get branch name
id: branch-name
uses: tj-actions/branch-names@v8
```
1. Creates a Neon database branch for the pull request with [`neondatabase/create-branch-action@v5`](https://github.com/marketplace/actions/neon-database-create-branch-action). By default, the branch name will be `preview/<git-branch-name>`
7. Creates a Neon database branch for the pull request with [`neondatabase/create-branch-action@v5`](https://github.com/marketplace/actions/neon-database-create-branch-action). By default, the branch name will be `preview/<git-branch-name>`
```yaml
- name: Create Neon Branch
id: create-branch
Expand All @@ -91,22 +91,22 @@ In that job it consists of the following steps:
username: "neondb_owner" # change this to your Neon database username if you're not using the default
api_key: ${{ env.NEON_API_KEY }}
```
1. Executes database migrations by setting up the `.env` file and running migration scripts.
8. Executes database migrations by setting up the `.env` file and running migration scripts.
```
- run: |
echo "DATABASE_URL=${{ steps.create-branch.outputs.db_url_with_pooler }}" >> "$GITHUB_ENV"

- run: pnpm run db:migrate
```
1. Deploys the application with [`superfly/[email protected]`](https://github.com/marketplace/actions/github-action-for-deplying-staging-apps-on-fly-io), while including the Neon database URL.
9. Deploys the application with [`superfly/[email protected]`](https://github.com/marketplace/actions/github-action-for-deplying-staging-apps-on-fly-io), while including the Neon database URL.
```yaml
- name: Deploy
id: deploy
uses: superfly/[email protected]
with:
secrets: DATABASE_URL=${{ steps.create-branch.outputs.db_url }}?sslmode=require
```
1. Comments on the pull request with deployment and database branch details using `thollander/actions-comment-pull-request@v2`. Here's an [example comment](https://github.com/neondatabase/preview-branches-with-fly/pull/9#issuecomment-1924660371)
10. Comments on the pull request with deployment and database branch details using `thollander/actions-comment-pull-request@v2`. Here's an [example comment](https://github.com/neondatabase/preview-branches-with-fly/pull/9#issuecomment-1924660371)
```yaml
- name: Comment on Pull Request
uses: thollander/actions-comment-pull-request@v2
Expand Down
Loading