Deploy Quarto on Github pages on a custom domain
For this website I wanted to publish it on a custom subdomain (til.mone27.net) and not on the default one (mone27.github.io). Doing this with quarto was slightly more complicated than I thought, so I wanted to document the steps I took to get it working.
The first thing is to add a custom domain in your github account and the in the repo pages settings. I am working with subdomain (not top level domain) so I had to add a CNAME record in my DNS settings poining to mone27.github.io.
Then you need to add a CNAME file in the root of your repo with the custom domain name. In my case it was til.mone27.net. Now we need to convince quarto to also bring this file to the output directory (when deploying using CI).
Thanks to this helpful post I found that that in the _quarto.yml under the the project section I needed to add:
project:
type: website
resources:
- CNAMEThis works! Last step is to enforce HTTPS on github pages and we are ready to go.