Skip to content

Create nextjs.yml#16

Merged
Dargon789 merged 1 commit intomasterfrom
Dargon789-patch-2
Jul 5, 2025
Merged

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

Conversation

@Dargon789
Copy link
Owner

@Dargon789 Dargon789 commented Jul 5, 2025

Summary by Sourcery

Introduce a GitHub Actions workflow to build and deploy the Next.js site to GitHub Pages

New Features:

  • Add nextjs.yml workflow triggered on pushes to master and manual dispatch
  • Add build job that detects package manager, sets up Node.js 20, caches dependencies, and builds the site
  • Add deploy job to publish built artifacts to GitHub Pages with proper permissions and concurrency controls

@sourcery-ai
Copy link

sourcery-ai bot commented Jul 5, 2025

Reviewer's Guide

Introduce a new GitHub Actions workflow to automate building and deploying the Next.js site to GitHub Pages with package manager detection, caching, artifact upload, and deployment steps.

Flow diagram for Next.js CI/CD pipeline in nextjs.yml

flowchart TD
  Start([Start: Push to master or manual trigger]) --> Checkout[Checkout code]
  Checkout --> Detect[Detect package manager]
  Detect --> SetupNode[Setup Node.js]
  SetupNode --> SetupPages[Setup Pages]
  SetupPages --> RestoreCache[Restore Next.js cache]
  RestoreCache --> InstallDeps[Install dependencies]
  InstallDeps --> Build[Build with Next.js]
  Build --> Upload[Upload build artifact]
  Upload --> Deploy[Deploy to GitHub Pages]
  Deploy --> End([Site live on GitHub Pages])
Loading

File-Level Changes

Change Details Files
Configure workflow triggers, permissions, and concurrency
  • Define triggers for push to master and manual dispatch
  • Set GITHUB_TOKEN permissions for pages deployment
  • Enable a concurrency group to prevent overlapping runs
.github/workflows/nextjs.yml
Implement build job with package manager detection and caching
  • Add step to detect npm vs. yarn and output relevant commands
  • Setup Node 20 environment with package cache
  • Configure actions/cache to preserve .next/cache between runs
.github/workflows/nextjs.yml
Add build, artifact upload, and deployment jobs
  • Install dependencies and run next build using detected manager
  • Upload the generated out folder as a Pages artifact
  • Deploy the artifact to GitHub Pages using actions/deploy-pages
.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 @Dargon789 - I've reviewed your changes and they look great!


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.

Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>
@Dargon789 Dargon789 force-pushed the Dargon789-patch-2 branch from 7f9b649 to 41800fa Compare July 5, 2025 01:22
@Dargon789 Dargon789 merged commit 98b3e59 into master Jul 5, 2025
22 checks passed
@Dargon789 Dargon789 deleted the Dargon789-patch-2 branch July 5, 2025 03:23
@Dargon789 Dargon789 linked an issue Oct 2, 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

None yet

Development

Successfully merging this pull request may close these issues.

GitHub Actions GKE deployment workflow

1 participant