Nextjs automatic deployment to a cpanel using github actions - github

I have successfully deployed a static html, css site to my "Bluehost" cPanel using GitHub actions, when I tried to deploy my Next.js app I failed, during the first try I get a plain web page with index and the folders of my projects after doing some research I have tried to upload the build folder to the FTP and it gave me the same error.
The plain web page after uploading the build folder files:
Anyway I know that I'm doing it the wrong way. All I'm asking for is the best automated way to deploy my Next.js app to the cPanel using GitHub actions or any other automated tools.

Related

How do I inject a file into a Netlify deploy from Github to avoid using git-lfs?

I have a Netlify site that deploys from Github. The problem is that it contains a WebGL Unity game which has a pretty big .data file. The file is bigger than 100MB so it would need to be storged in Github's LFS. I don't want to use Github LFS so is there a way to store this file in an external link like Google Drive or Dropbox or something like that and inject it into the deploy at build time?

Deploying a MERN app to render.com with one main folder structure - not separate front and back

I have a MERN app that I would like to deploy to render.com. I just have 2 quick questions:
Of all the tutorials that I have watched, they all have separate github repos - 1 for the frontend, 1 for the backend. So on render.com, they can simply choose the frontend or the backend repo when they want to deploy. However, my folder structure is not like this - mine is one main github repo, and inside that repo, there is 1 frontend folder and 1 backend folder. How do I go about solving this?
When I give render.com (or heroku, netlify, etc.) access to my github account, is it safe? Does this mean they will be able to read and change stuff in my github account?
Thanks in advance for your help
My repo has the same structure as yours, one frontend folder and one backend folder.
You need to create a new Web Service for your backend folder. When creating a new web service, just set the Root Directory to backend. When you're done with the other fields and deployed your backend, create a Static Site for your frontend. Set the root directory of your static site to frontend. Set Publish Directory to build.
Probably safe but I'm new to the service as well. I believe they are only using that to be able to pull your repositories so that you can select them on Render. And also, of course, for auto or manual deployment.

Automate the process of uploading a new build to a website. i.e. npm run build -> cpanel upload

I am managing a mostly static site through GoDaddy.
The site is a React single page application, that is still currently under development, and that occasionally needs content updating. The project folder is hosted as a public git repository.
My goal is to be able to automate the process of updating the site. Currently I need to:
npm run build
navigate to the build folder in windows file explorer
navigate to the public html folder in cpanel, in my web browser
delete the current build files
upload the contents of the build files into cpanel, folder by folder (cpanel will not allow me to upload subfolders)
I have looked through countless forum posts, and blogs, etc to find a way to automate this, but I always end up doing it manually.
You need to investigate using continuous deployment (CD/CI) and using a different hosting setup. Unfortunately, the type of platform that you use (with CPanel) is limiting and is not really oriented at your use case.
However, CPanel does have an option to use Git version control to manage the files and folders in your account. Go into this option and say "Clone repository", where you'll have to link a repo and say where it should install. Note: It is possible that your hosting provider has disabled this feature.
I suspect that this CPanel feature does not automatically pull in changes when you update the repo, so you would probably still need to manually clone the repo again when you make changes (which is still easier than copying files over). Also note that any data you store may be removed when cloning again.

"Site has not yet been deployed" after netlify deployment

I already tried a million times and not able to figure out where I am going wrong. I tried simple static website repo. I even added parcel bundler. I just get same error message.
I even forked netlify's own demo repo. And I got same message. Why I am not able to deploy the site?
I looked at forums, blogs and even answer in this forum and I am not finding clue to this exact message. I didn't have netlify.toml file. I added that file too and I don't see any change in deployment status.
Initially I was trying to just create site online by connecting to GitHub repo. When I tried Netlify-CLI I could see some deploy action happen. But server was not render. Found a guide here: https://github.com/Tanu-N-Prabhu/Multiplication-Table-App
Followed last 3 steps under Deployment section:
Go to your Netlify Dashboard to the project. Click on Site has not yet been Deployed. Again click on Deploy Preview this will unlock the Preview Deploy which is a temporary URL.
After viewing the Preview, click on Publish deploy option to deploy your project.
Now your project is live and deployed on the internet.
These steps worked. But Javascript files were not rendering. I wonder why the whole process is so cumbersome when they advertise everything is taken care by Netlify automatically? There is no document for Site has not yet been deployed on their site and google search only leads me to Page not found forum page.
You must add the --prod.
The command should look like this: netlify deploy --prod.
This fixed it for me.

How do i manage content workflow for hexo site?

I've used static site generators like jekyll and had it hosted through github pages just fine using prose.io as a content management system.
I decided I wanted to go with a site using Hexo static site generator, but I cannot seem to figure out a good workflow for publishing content.
To my understanding this is the following in how I'd have to do it:
write *.md text file
hexo generate
(optional) hexo serve (to see local content)
hexo deploy (to publish the public content to whatever site using config.yml). Can publish on amazon S3, github pages, etc
Is there another workflow other than this?
the way I've been doing it before with jekyll+github pages is simply
go to prose.io
Write content
save (which publishes ocntent)
Ideally I'd like to use hexo+github pages the same way I do with jekyll+github pages.
Basically, can github generate static files automatically like it does with jekyll / ruby packages?
I figured out my own answer and posted it on my blog
http://www.tangycode.com/Quick-Start-Guide-To-Hexo-Install/
It covers everything you need to know on how to set up a hexo blog site and manage content workflows
One approach I am trying myself:
prose.io or similar to write and save on github repository
travis-ci.org to build hexo site and deploy
This is how it works:
Edit document on your editor of love
Commit it to your repository
travis-ci.org detects the commit and start working
My .travis.yml do (among few other things) the follow:
npm install hexo-cli
npm install grunt-cli
npm install inside siteĀ“s repository (hexo plugins and dependecies)
hexo generate
grunt deploy-production
hexo deploy (I use this to have a historic of the site stored in the repo itself)
If your editor of choice can direct commit to github repository your have exact same experience you had with Jekyll on GH pages. The advantage here is that you can use third-part plugin what GH pages avoid.
Alternatively, you can use INSTANT, which is a content management tool that you can use on any static website. You just install their javascript and can directly edit content in your website (without any admin dashboard). It saves and serves the content from the client. Pretty neat.
The easiest way is to use a hosting provider like Netlify in combination with a headless CMS, for example Headless (full disclore: I created it).
Netlify can do the build process for you and during that build process, it can fetch content from a headless CMS. Whenever you update content in the CMS, then Netlify does a rebuild.
Then you have your website on the Netlify CDN, a real CMS for your content management and you never need to dive in your code or github files. And that's all for free.