Implement NextJs and Github Actions Build Caching for the Dapp #165
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.
Fixes #160
next.config.js: I Configured Next.js to use webpack 5 and filesystem caching. This configuration ensures that Next.js can leverage caching for faster rebuilds.
So I Modified the workflow file (.github/workflows/nodejs.yml) to include caching steps.
This will optimize the workflow by reusing dependencies across workflow runs.
Changes done are as follows
next.config.js: Configures Next.js to use webpack 5 and filesystem caching. This configuration ensures that Next.js can leverage caching for faster rebuilds.
GitHub Actions Workflow:
Caching: Utilizes GitHub Actions caching (actions/cache@v2) to cache npm dependencies (~/.npm) between workflow runs. This speeds up npm installs and builds.
next build: Uses npx next build instead of npm run build to trigger the Next.js build process directly. This ensures that Next.js caching mechanisms are utilized effectively.
By implementing these changes, you should see improvements in build performance due to optimized caching strategies both within Next.js and in your GitHub Actions workflow.