Here come some useless knowledge! This article mainly records some tips on GitHub.

Why use GitHub?

  • Code management
  • Get GitHub Pages and Actions for free!

Special Repositories

There are mainly two types of special repositories: one is username.github.io, and the other is username/username (both personal and organization accounts have these two types of repositories).

username.github.io

The main purpose of this type of repository is to host personal blogs, but it can also be used to host other things, such as personal websites, documentation for personal projects, etc. GitHub Pages will automatically host the content of this repository at the address https://username.github.io.

username/username

This type of repository is generally used to host information about a personal account, such as a profile. Open your homepage; the content of the file README.md in this repository is your profile.

Reference: yyyanbj - GitHub1

For organization accounts, it is slightly different. You need to place it in the file profile/README.md within the repository organization/.github.

Reference: awesome-actions-template - GitHub2

GitHub Pages

Custom Domain

Generally, you need to place a file named CNAME in the root directory of your repository’s GitHub Pages, write your domain name inside it, and then add a CNAME record at your domain’s DNS provider. For a subdomain like www, point it to username.github.io. Additionally, add a A record for a subdomain like @, pointing to the IP address of GitHub Pages. If you are using a blog engine, you should place the CNAME file in the static directory of your blog engine.

1
2
3
4
185.199.108.153
185.199.109.153
185.199.110.153
185.199.111.153

warning

Note that the IP addresses here are time-sensitive. If you find these IP addresses have expired, you can find the latest ones at Managing a custom domain for your GitHub Pages site - GitHub Docs[^cite-3].

If you are an IPv6 user, you also need to add a AAAA record. For a subdomain like @, point it to the IPv6 address provided in Managing a custom domain for your GitHub Pages site - GitHub Docs3.

GitHub Actions

github-actions[bot]

Now that GitHub Actions has been updated, permission management has become more granular. By default, github-actions[bot] often does not have write permissions for the repository and needs to be added manually.

Addition method: Settings -> Actions -> General -> Workflow permissions -> Read and write permissions -> Save

Pro Account

If you are a student, you can apply for a free Pro account with a Pro Plan at education.github.com. You can then use GitHub Actions and GitHub Pages in the Private repository.

GitHub Emoji

GitHub has its own Emoji, which can be found at GitHub Emoji Cheat Sheet4 and used in issues, commit messages, Discussions, etc. Of course, you can also use them in the comment section below, which is powered by giscus!

Conclusion

Updated irregularly QAQ