Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement NextJs and Github Actions Build Caching for the Dapp #165

Closed
wants to merge 5 commits into from

Conversation

kamalbuilds
Copy link

Fixes #160

  1. For Nextjs caching ,

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.

  1. Implementing GitHub Actions Build Caching: GitHub Actions supports caching to speed up workflows. We can cache the npm dependencies and any other build artifacts between workflow runs.

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.

@Julian-dev28
Copy link
Contributor

Screenshot 2024-07-16 at 5 57 37 PM It looks like the build failed. Please see the attached screenshot

@kamalbuilds
Copy link
Author

ok @Julian-dev28 taking a look at this

@kamalbuilds
Copy link
Author

@Julian-dev28 please run the workflow

@Julian-dev28
Copy link
Contributor

resolved by #170

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