Open
Conversation
deploy next.js site to pages Signed-off-by: Dargon789 <64915515+Dargon789@users.noreply.github.com>
|
Note Gemini is unable to generate a summary for this pull request due to the file types involved not being currently supported. |
Reviewer's GuideAdds a GitHub Actions workflow to build a Next.js project and deploy it to GitHub Pages on pushes to the main branch or manual dispatch, including package manager detection, build caching, and a separate deployment job. Sequence diagram for Next.js build and deploy workflow executionsequenceDiagram
actor Developer
participant GitHub_Repository
participant GitHub_Actions
participant Build_Job
participant Deploy_Job
participant GitHub_Pages
Developer->>GitHub_Repository: Push to main or trigger workflow_dispatch
GitHub_Repository->>GitHub_Actions: Trigger workflow nextjs.yml
GitHub_Actions->>Build_Job: Start build job
Build_Job->>Build_Job: Checkout repository
Build_Job->>Build_Job: Detect package manager (yarn or npm)
Build_Job->>Build_Job: Setup Node 20 with dependency cache
Build_Job->>Build_Job: Configure Pages for Next.js static_site_generator
Build_Job->>Build_Job: Restore .next cache
Build_Job->>Build_Job: Install dependencies
Build_Job->>Build_Job: Run next build
Build_Job->>GitHub_Actions: Upload Pages artifact from ./out
GitHub_Actions->>Deploy_Job: Start deploy job (needs build)
Deploy_Job->>GitHub_Pages: Deploy artifact using actions/deploy-pages
GitHub_Pages-->>Deploy_Job: Return page_url
Deploy_Job-->>GitHub_Actions: Set environment url output
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The workflow always assumes Yarn or npm based solely on
yarn.lock/package.json; if you might use pnpm or another manager later, consider extendingDetect package managerto detect those lockfiles explicitly to avoid misconfigured installs. - The artifact upload path is hard-coded to
./out, which only exists for static export setups; consider aligning this with the actual Next.js build output (e.g., respectingoutput: 'export'or.next), or making it configurable to avoid silent deployment issues if the build directory changes.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The workflow always assumes Yarn or npm based solely on `yarn.lock`/`package.json`; if you might use pnpm or another manager later, consider extending `Detect package manager` to detect those lockfiles explicitly to avoid misconfigured installs.
- The artifact upload path is hard-coded to `./out`, which only exists for static export setups; consider aligning this with the actual Next.js build output (e.g., respecting `output: 'export'` or `.next`), or making it configurable to avoid silent deployment issues if the build directory changes.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
deploy next.js site to pages
Please, go through these steps before you request a review:
📝 Describe your changes
🔎 Attach a source of truth or evidence that allows reviewers to confirm the changes independently
Summary by Sourcery
CI: