Skip to content

docs: add neon functions github actions guide - #5469

Open
dhanushreddy291 wants to merge 7 commits into
neondatabase:mainfrom
dhanushreddy291:add-docs/neon-functions-ci
Open

docs: add neon functions github actions guide#5469
dhanushreddy291 wants to merge 7 commits into
neondatabase:mainfrom
dhanushreddy291:add-docs/neon-functions-ci

Conversation

@dhanushreddy291

@dhanushreddy291 dhanushreddy291 commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

@vercel

vercel Bot commented Aug 7, 2026

Copy link
Copy Markdown

@dhanushreddy291 is attempting to deploy a commit to the neondatabase Team on Vercel.

A member of the Team first needs to authorize it.

@vercel

vercel Bot commented Aug 7, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
neon-next Ready Ready Preview Aug 7, 2026 8:50am

Request Review

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new guide under content/guides/ that walks readers through setting up CI/CD for Neon Functions using GitHub Actions, including per-PR preview functions, production deploys on main, and cleanup on PR close.

Changes:

  • New end-to-end tutorial for building and deploying a Neon Function (Hono + Postgres) via the Neon CLI.
  • Adds a GitHub Actions workflow example covering preview deploys, production deploys, and cleanup.
  • Adds supporting references and screenshots for PR comments and multi-function previews.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +6 to +7
createdAt: '2026-08-06T00:00:00.000Z'
updatedOn: '2026-08-07T08:36:27.530Z'

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no updatedOn is present in all guides

Comment on lines +255 to +258
# Ensures only the latest commit runs, preventing race conditions in concurrent PR updates
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated.

Comment on lines +290 to +294
- uses: actions/checkout@v7

- uses: actions/setup-node@v7
with:
node-version: 24

@dhanushreddy291 dhanushreddy291 Aug 7, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

used v7 for both jobs

uses: actions/github-script@v7
with:
script: |
const urls = fs.readFileSync('function_urls.txt', 'utf8');

@dhanushreddy291 dhanushreddy291 Aug 7, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated now. the pr was in draft before, so didn't double check it earlier.

@dhanushreddy291 dhanushreddy291 Aug 7, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed the fs and the edit comment functionality for simplicity of the yaml file.
The comments by the bot will be stacked on new updates to a PR now (instead of in-place edit)


## Understanding the workflow

The workflow has three jobs, and each one runs the same idea: deploy function to a branch. Because functions are branch-scoped, every environment ends up with its own function at its own URL, running against its own database state. Thinking of it as "deploy to a branch" makes the whole workflow easy to follow.

@dhanushreddy291 dhanushreddy291 Aug 7, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated to The workflow (excluding the setup) has three main jobs :

npm install --save-dev @types/pg typescript dotenv
```

You now have a project linked to Neon and the necessary dependencies to build a Hono based API that interacts with your Neon Postgres database.

The workflow has three jobs, and each one runs the same idea: deploy function to a branch. Because functions are branch-scoped, every environment ends up with its own function at its own URL, running against its own database state. Thinking of it as "deploy to a branch" makes the whole workflow easy to follow.

- **Deploy preview**: Runs when a PR is opened, reopened, or updated. It creates an isolated branch, deploys to it, comments the preview URL on the PR, and leaves the preview url as a comment for review.
@dhanushreddy291
dhanushreddy291 marked this pull request as ready for review August 7, 2026 11:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants