stellar / soroban-example-dapp

End-to-End Example Soroban Dapp
Apache License 2.0
1.05k stars 853 forks source link

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

Closed kamalbuilds closed 2 weeks ago

kamalbuilds commented 1 month ago

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 commented 1 month ago
Screenshot 2024-07-16 at 5 57 37 PM

It looks like the build failed. Please see the attached screenshot

kamalbuilds commented 1 month ago

ok @Julian-dev28 taking a look at this

kamalbuilds commented 1 month ago

@Julian-dev28 please run the workflow

Julian-dev28 commented 2 weeks ago

resolved by #170