Deploy Angular app to GitHub Pages without project name in the url - deployment

I want to deploy my Angular app to GitHub Pages. But instead of https://yourgithubusername.github.io/yourprojectname/, I want something like https://yourgithubusername.github.io. Is it possible to do so?

Create a project named username.github.io :
https://github.com/username/username.github.io
Your project will be deployed to https://username.github.io ( static page)
Check document Websites for you and your projects.

Related

Cant deploy site on either github pages or netlify. Nuxt2 and Tailwind project

Hello i have build a project in Nuxt2 and Tailwind. But I cant deploy it on github pages or netflify..
Here is my project in guthub https://github.com/Astborg/cocktailappNuxt/
On github pages its just loading..
on netlify it failes;
Here is the URL of a hosted app: https://vocal-dusk-d7176e.netlify.app/
Here are my build settings
And here are some changes that I did to your project to have it properly hosted on Netlify: https://github.com/kissu/cocktailappNuxt/blob/main/nuxt.config.js#L3
Simplest advice for you:
Build from main
Add an index.html and .nojekyll file in the root
Make sure the builds restart and you're page will be up and running.

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.

Nextjs automatic deployment to a cpanel using github actions

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.

Link custom domain to any GitHub repo

I am aware that on GitHub you can create a repository, <username>.github.io, which will be a personal website. I also understand you can link custom domains to this, so example.com would show the website in your GitHub repo.
I have a couple questions though.
At the moment, I have a GitHub project - let's call it FooProject. I have purchased a custom domain name for a website to showcase the project. How can I create a website for this, hosted on GitHub? (not a personal site in the form <username>.github.io, but a project site).
Also, can I give the GitHub repository a different name like fooproject.com, or does it something specific?
I suppose what I am really asking is, when hosting a website on GitHub...
Can you host your website using a GitHub repository of any name (like fooproject.com)?
If not, I'm aware of using gh-pages branches for the website of a project. How would this work with a custom domain?
If that isn't a good option either, what's the best option for my use case?
Hope that's clear.
So I managed to answer my own questions in the end - here's what I did.
My website is going to be something to showcase a different project I am working on. I could have hosted the website from a /doc directory or gh-pages branch in my project repository and then set up a custom domain from there.
However, there was also the option of creating a repository with any name and hosting the website from the master branch - this method appealed to me more.
I created a new repository named the same as my domain name, example.com (it doesn't really matter what you call the repository). Then, using git, I added some website files - index.html, stylesheet.css, etc.
Once my repository was ready, I configured its master branch as a publishing source for GitHub pages - see this help page for details.
Then with my DNS provider (GoDaddy, in my case), I configured the CNAME and A records (for the www subdomain and apex domain respectively). There are also help pages on GitHub for setting up www subdomains and setting up apex domains. Note that it takes a little while for the changes made on the DNS to take effect.
Finally, I added my custom domain to my GitHub repository - see the GitHub help page for adding or removing custom domains.
Here's a summary (for using any GitHub repository to host a website):
Create your repository - repository name doesn't matter.
Add your website files - HTML, CSS, JavaScript, etc.
Configure the master branch as a publishing source
Configure CNAME and A records with DNS provider
Add the custom domain to the GitHub repository settings

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.