<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Github on Salar Rahmanian</title><link>https://www.softinio.com/tags/github/</link><description>Recent content in Github on Salar Rahmanian</description><generator>Hugo</generator><language>en</language><lastBuildDate>Sat, 14 Jan 2023 16:45:33 -0800</lastBuildDate><atom:link href="https://www.softinio.com/tags/github/index.xml" rel="self" type="application/rss+xml"/><item><title>Configuring Github Pages With a Custom Domain</title><link>https://www.softinio.com/til/configuring-github-pages-with-a-custom-domain/</link><pubDate>Sat, 14 Jan 2023 16:45:33 -0800</pubDate><guid>https://www.softinio.com/til/configuring-github-pages-with-a-custom-domain/</guid><description>&lt;p&gt;To setup my custom domain I went through the following steps:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;em&gt;Verify Domain:&lt;/em&gt; I followed &lt;a href="https://docs.github.com/en/pages/configuring-a-custom-domain-for-your-github-pages-site/verifying-your-custom-domain-for-github-pages"&gt;these steps&lt;/a&gt; to verify. Note that this was done using my GitHub accounts settings and not the repositories settings.&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Configuring my subdomain:&lt;/em&gt; Next I configured my subdomain to be used as my custom domain with GitHub pages by following &lt;a href="https://docs.github.com/en/pages/configuring-a-custom-domain-for-your-github-pages-site/managing-a-custom-domain-for-your-github-pages-site#configuring-a-subdomain"&gt;these steps&lt;/a&gt; which involved adding a CNAME record to my DNS settings with my domain registrar. Note that as I was using a subdomain adding a CNAME record was all that was needed (however if I was to use an apex domain, I would have needed to add A and AAAA records too pointing to GitHub&amp;rsquo;s ip addresses).&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Add CNAME file:&lt;/em&gt; You need to add a file called &lt;code&gt;CNAME&lt;/code&gt; to the root of your generated static site that contains your host name only (i.e. for this site &lt;code&gt;til.softinio&lt;/code&gt;). As I use Hugo, I put this in the &lt;code&gt;static&lt;/code&gt; directory as when the site is created it will be put in the root. Here is an &lt;a href="https://github.com/softinio/til/blob/main/static/CNAME"&gt;example&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Configuring GitHub Pages:&lt;/em&gt; Go to your repositories settings and select pages. Enter your domain name, save it and click check. Tick the box to enforce &lt;code&gt;https&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id="notes"&gt;Notes&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;This TIL does not cover setting up GitHub actions to build and deploy your code. Here is a &lt;a href="https://github.com/softinio/til/tree/main/.github/workflows"&gt;sample&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;You need to have your site deployed at least once so that the &lt;code&gt;gh-pages&lt;/code&gt; branch is created so that you can set the site source branch in your repositories pages settings.&lt;/li&gt;
&lt;li&gt;To make sure your GitHub actions is able to create the &lt;code&gt;gh-pages&lt;/code&gt; branch, go to your repositories settings, then click &lt;code&gt;Actions&lt;/code&gt; then &lt;code&gt;General&lt;/code&gt; and under the &lt;code&gt;workflow permissions&lt;/code&gt; section make sure the &lt;code&gt;read and write permissions&lt;/code&gt; is selected and saved.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="references"&gt;References&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://gohugo.io/hosting-and-deployment/hosting-on-github/"&gt;Hugo Documentation for hosting on GitHub&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</description></item></channel></rss>