Private Repository Github Pages Page Publishing

Hello, I am using github pages for my personal blog.
There is a section on the blog where the codes are secret.
For this, the idea of ​​opening a private repo came to my mind. Does this work? Can I convert my private repo to github.io?

:wave: Welcome!

Yes, on a Pro account, you can have a pages site associated with a private repository.

On a free account, you can only have pages sites on public repositories.

We have more information here on the differences:

If you have secret codes that will get published to the blog, publishing from a private repository won’t keep them secret. Keep in mind that publishing to GitHub Pages (or any static blogging solution), even from a private repository, the site and all of the content that gets published will be public. If there are secrets in your source that do not get published to the page, having a private repository should help, but in general you should not keep secrets in your repository. We have a solution that’s accessible from GitHub Actions called Encrypted Secrets. This allows the secrets to be used during build time, and keeps them out of the published site.

thanks for your answer