About publishing sources
You can publish your site when changes are pushed to a specific branch, or you can write a GitHub Actions workflow to publish your site.
If you do not need any control over the build process for your site, we recommend that you publish your site when changes are pushed to a specific branch. You can specify which branch and folder to use as your publishing source. The source branch can be any branch in your repository, and the source folder can either be the root of the repository (/
) on the source branch or a /docs
folder on the source branch. Whenever changes are pushed to the source branch, the changes in the source folder will be published to your GitHub Pages site.
If you want to use a build process other than Jekyll or you do not want a dedicated branch to hold your compiled static files, we recommend that you write a GitHub Actions workflow to publish your site. GitHub provides workflow templates for common publishing scenarios to help you write your workflow.
Warning
Unless your enterprise uses Enterprise Managed Users, GitHub Pages sites are publicly available on the internet by default, even if the repository for the site is private or internal. You can publish a site privately by managing access control for the site. Otherwise, if you have sensitive data in your site's repository, you may want to remove the data before publishing. For more information, see About repositories and Changing the visibility of your GitHub Pages site.
Publishing from a branch
-
Make sure the branch you want to use as your publishing source already exists in your repository.
-
On GitHub, navigate to your site's repository.
-
Under your repository name, click Settings. If you cannot see the "Settings" tab, select the dropdown menu, then click Settings.
-
In the "Code and automation" section of the sidebar, click Pages.
-
Under "Build and deployment", under "Source", select Deploy from a branch.
-
Under "Build and deployment", use the branch dropdown menu and select a publishing source.
-
Optionally, use the folder dropdown menu to select a folder for your publishing source.