Deploying App to Custom Domain - Porkbun
-
In Porkbun, click "Domain Management," and then click on the "website" icon of the domain you want to
set up.
-
Connect to Github. When connecting Github, you can choose an individual repository or select all
repositories. Once connected and returned to Porkbun, choose the Branch that you want to connect. If
React - it's gh-pages
-
Navigate back to "Domain Management." Click on "Details" next to the domain that you are setting up to
show a dropdown menu, and click on "Edit" next to "DNS RECORDS."
-
In the "DNS Records Menu" add a "CNAME" type using the "Quick DNS Config." Select "Github."
-
The "Host" will remain "www,"" and the "Answer" should be your Github username. For instance:
example.github.io
-
In the same "DNS Records Menu," add a TXT type. Follow this Github tutorial:
https://docs.github.com/en/pages/configuring-a-custom-domain-for-your-github-pages-site/verifying-your-custom-domain-for-github-pages
-
After the "CNAME" and "TXT" types have been added to the "DNS Records," Navigate to your Github
repository, click "settings," and then click "pages."
-
Add the domain name to the "Custom Domain" text field and save. If set up correctly it will show "DNS
check successful" after saving the domain. A CNAME should be created and added to the root of the GitHub
repository. Use "git pull" to merge the remote repository with the local repository.
*** If no CNAME file is automatically created, create one in your text editor in the main root and push
to GitHub. The file name should be "CNAME" and the content should only be the url of the website. Ex:
example.com ***
-
In your text editor, open the package.json file and change the "homepage" from the github repository to
the name of your domain. Push that change to Github.
*** Make sure the "homepage" URL retains the "http://". ***