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

Add a command to deploy on IPFS with Spheron CLI #303

Closed
wants to merge 7 commits into from

Conversation

rekpero
Copy link

@rekpero rekpero commented Apr 10, 2023

I've added a command npm run spheron or yarn spheron to build directly, export it to static files and then upload to ipfs using spheron CLI.
You can even change it to Filecoin or Arweave by changing the spheron.json inside nextjs to filecoin or arweave.

My intention of doing this is inspired by the original scaffold-eth ipfs command in the react-app package to deploy the app on IPFS.

Let me know if there are any changes needed somewhere. I am happy to talk about it in the PR.
Happy buidl, guys!

@rekpero
Copy link
Author

rekpero commented Jun 11, 2023

Hey @sverps @technophile-04 I just rebased my branch with main. Let me know if there is anything needed to be updated. Would love to see this merged.

@@ -11,7 +11,8 @@
"format": "prettier --write . '!(node_module|.next|contracts)/**/*'",
"check-types": "tsc --noEmit --incremental",
"vercel": "vercel",
"vercel:yolo": "vercel --build-env NEXT_PUBLIC_IGNORE_BUILD_ERROR=true"
"vercel:yolo": "vercel --build-env NEXT_PUBLIC_IGNORE_BUILD_ERROR=true",
"spheron": "next build && next export && spheron login --github && spheron publish"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we instead use spheron upload --path ./out --protocol ipfs and omit the spheron.json file? I prefer to keep the optional config files to a minimum to avoid potentially confusing users.

@@ -11,7 +11,8 @@
"format": "prettier --write . '!(node_module|.next|contracts)/**/*'",
"check-types": "tsc --noEmit --incremental",
"vercel": "vercel",
"vercel:yolo": "vercel --build-env NEXT_PUBLIC_IGNORE_BUILD_ERROR=true"
"vercel:yolo": "vercel --build-env NEXT_PUBLIC_IGNORE_BUILD_ERROR=true",
"spheron": "next build && next export && spheron login --github && spheron publish"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the newly added local blockexplorer, next export fails since it doesn't work with getServerSideProps. So we'll have to think about a potential solution for this.

Maybe in favor of ipfs deployment options (and potentially other deployment options that require next export) we could opt to omit the code tab from the blockexplorer while thinkink of a different way to include it (since I think the value of that tab might be rather limited). What do you think @carletex @technophile-04

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, I had maintained todo #351 (review) check out points 2 and 3, also mentioned possible solution there nextjs pageExtensions but I will create an issue for pt.2 and 3 🙌

@sverps
Copy link
Collaborator

sverps commented Jun 11, 2023

Hey @rekpero , sorry for not picking this up sooner. Let's try and get this included, always nice to provide users with some options for deployment. Added some comments.

@technophile-04
Copy link
Collaborator

technophile-04 commented Jun 13, 2023

Hey, @rekpero really sorry for reviewing it late 😅

Issuese noticed :

My Thoughts :

  • Looking at how SE-1 handles deployment to ipfs, it has a simple script which SE-1 script I would like to weight this option more due to its simplicity also protocol agnostic (if it's feasible at all)

  • We can always mention in a hint that for better CI / CD directly link their GitHub repo to services like Spheron , Valist Fleek etc as we have mentioned in se-2 docs

Some Question:

  • If we choose to go with some service in case first option is not feasible which will be the best service based on DX, best free tier, and less efforts....just listing a few on some research (would love to hear their basic advantages and disadvantages) :
    1. Spehron Cli
    2. Valist cli
    3. Fleek Cli
    4. others

Tysm @rekpero !! Sorry for the long review just wanted to make sure we choose the best tool which is simple, nice DX, has less friction, and provides the best free value 🙌

@technophile-04 technophile-04 marked this pull request as draft November 20, 2023 22:31
@technophile-04
Copy link
Collaborator

Closing this for now, please feel free to re-open

Thanks all 🙌

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.

3 participants