Skip to content

Comments

Create nextjs.yml#50

Merged
Dargon789 merged 1 commit intomasterfrom
Dargon789-patch-1
Aug 29, 2025
Merged

Create nextjs.yml#50
Dargon789 merged 1 commit intomasterfrom
Dargon789-patch-1

Conversation

@Dargon789
Copy link
Owner

@Dargon789 Dargon789 commented Aug 29, 2025

Summary by Sourcery

Add a new GitHub Actions workflow to build and deploy a Next.js site to GitHub Pages.

CI:

  • Create nextjs.yml workflow that triggers on pushes to master and manual dispatch
  • Detect package manager, set up Node, cache dependencies and build output, then upload and deploy the site

Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>
@vercel
Copy link

vercel bot commented Aug 29, 2025

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

Project Deployment Preview Comments Updated (UTC)
sequence.js Ready Ready Preview Comment Aug 29, 2025 3:51pm

@codesandbox
Copy link

codesandbox bot commented Aug 29, 2025

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

@bolt-new-by-stackblitz
Copy link

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@gemini-code-assist
Copy link

Note

Gemini is unable to generate a summary for this pull request due to the file types involved not being currently supported.

@sourcery-ai
Copy link

sourcery-ai bot commented Aug 29, 2025

Reviewer's Guide

Introduces a new GitHub Actions workflow to build and deploy a Next.js site to GitHub Pages, including custom package manager detection, caching, and deployment steps.

Sequence diagram for Next.js build and deploy workflow

sequenceDiagram
    participant GitHub as GitHub Actions
    participant Repo as Repository
    participant Node as Node Setup
    participant Pages as Pages Config
    participant Cache as Cache
    participant PM as Package Manager
    participant Next as Next.js Build
    participant Artifact as Artifact Upload
    participant Deploy as Deploy to Pages
    GitHub->>Repo: Checkout code
    GitHub->>PM: Detect package manager
    GitHub->>Node: Setup Node
    GitHub->>Pages: Setup Pages
    GitHub->>Cache: Restore cache
    GitHub->>PM: Install dependencies
    GitHub->>Next: Build site
    GitHub->>Artifact: Upload build artifact
    GitHub->>Deploy: Deploy to GitHub Pages
Loading

File-Level Changes

Change Details Files
Add initial Next.js GitHub Actions workflow
  • Create .github/workflows/nextjs.yml
  • Configure push-to-master and manual workflow_dispatch triggers
  • Set permissions for contents, pages, and id-token
  • Enable concurrency group with cancel-in-progress disabled
.github/workflows/nextjs.yml
Configure build job for Next.js site
  • Checkout repository and detect package manager (yarn or npm)
  • Setup Node.js v20 with dependency caching
  • Configure Pages action with next static site generator
  • Restore and save .next cache based on lockfiles and source hashes
  • Install dependencies and run next build
  • Upload build output to Pages artifact
.github/workflows/nextjs.yml
Configure deployment job for GitHub Pages
  • Define github-pages environment and capture page_url output
  • Set dependency on build job
  • Use actions/deploy-pages@v4 to deploy the artifact
.github/workflows/nextjs.yml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey there - I've reviewed your changes - here's some feedback:

  • The workflow only runs on the “master” branch, but many projects now use “main” by default—consider updating the branch filter or making it configurable.
  • You’re uploading ./out but never run next export after next build, so the static files won’t actually be generated—add an export step to populate the out folder.
  • You cache only .next/cache, but adding a cache for node_modules (or your package manager’s install directory) can further speed up CI runs.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The workflow only runs on the “master” branch, but many projects now use “main” by default—consider updating the branch filter or making it configurable.
- You’re uploading `./out` but never run `next export` after `next build`, so the static files won’t actually be generated—add an export step to populate the `out` folder.
- You cache only `.next/cache`, but adding a cache for `node_modules` (or your package manager’s install directory) can further speed up CI runs.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@Dargon789 Dargon789 merged commit 69c3d47 into master Aug 29, 2025
12 of 13 checks passed
@Dargon789 Dargon789 deleted the Dargon789-patch-1 branch August 29, 2025 15:58
@Dargon789 Dargon789 linked an issue Aug 29, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

LiFi EIP-4337

1 participant