hector-sab / hectorsabblog

1 stars 0 forks source link

How to deploy the website #1

Closed hector-sab closed 1 year ago

hector-sab commented 1 year ago

I am trying to determine where/how to deploy the static website. A few options are:

hector-sab commented 1 year ago

For now I'll try to stick with the free offering. Porkbun gets discarded as the free tire is in beta and might die on me if they phase it out.

hector-sab commented 1 year ago

I'll stick with Azure static web apps for now as I want to try them out.

I am discarding Github Pages for now, no real solid reason of this except that I deal with it in the past already. Also, I am passing on Netlify for now has their pricing website showed a somewhat similar offering as the one from azure, tho I might try it out later.

hector-sab commented 1 year ago

With Azure SWA we have three ways of deploying: Github, Azure DevOps, and Others. I gotta test Others at some point. For now I'll go with Github

hector-sab commented 1 year ago

There's a build preset for Hugo. That will make my life easier :sweat_smile: tho I wonder what could be done with custom.

image

hector-sab commented 1 year ago

Ok, all worked out! Now I need to setup a custom domain name.

I have found this on how to set up the custom domain name, but I will probably need this from porkbun to set it up; my test domain name is from porkbun.

Also, what are the advantages from using CNAME (Canonical Name Record) vs AAAA (IPv6 Address Record)?

hector-sab commented 1 year ago

More on CNAME and AAAA records here

hector-sab commented 1 year ago

It turns out I might not need to use AAAA at all. Azure asks to validate the ownership of the domain, and that's either done by TXT validation, or using a CNAME.

I'll go with TXT just for checking it out. Here and here we can read a bit about it.

image

hector-sab commented 1 year ago

I'll need to set up a CNAME at the end. https://go.microsoft.com/fwlink/?linkid=2162243 image

hector-sab commented 1 year ago

What's apex vs www domain? https://learn.microsoft.com/en-us/azure/static-web-apps/custom-domain?wt.mc_id=azurestaticwebapps_inline_inproduct_general#create-an-alias-record

hector-sab commented 1 year ago

It is working! I needed to create a CNAME record in azure, and then add it to porkbun for it to work. image

Docs: https://learn.microsoft.com/en-us/azure/static-web-apps/custom-domain-external


Now the issue is that removing the www redirects it to porkbun, and I don't know why. image

This is how the records look like as of right now, I think it has to do with the first one. image


More details on what I did:

The root can also be called a “naked domain” and is usually represented by an @ symbol when you are configuring a record. [Source]

Were www.pptjuego.com is the (I assume Fully Qualified Domain Name, aka FQDN) and pptjuego.com is the root.

hector-sab commented 1 year ago

Interesting blog on how to set a CDN to use https on static websites on storage containers https://wrightfully.com/azure-static-website-custom-domain-https

hector-sab commented 1 year ago

Now the issue is that removing the www redirects it to porkbun, and I don't know why.

I just tested changing the ALIAS for pptjuego.com to the answer of www.pptjuego.com and that fixed it. Bear in mind that for the change will need a couple minutes to take effect. At first I was having this view below, but after a couple minutes, it started redirecting me to the actual page hosted in azure. image