Setup GitHub pages for private fork - AST-Course/AST5110 GitHub Wiki
Objective: To use GitHub Pages in conjunction with Jupyter Book to publish the course's wiki and notebooks, leveraging an existing GitHub Actions workflow in the private repository for AST5110
.
Steps:
-
Clone the
gh-pages
Branch Locally:
Create a localgh-pages
branch that tracks thegh-pages
branch from the upstream public repository.git checkout -b gh-pages upstream/gh-pages
-
Push the
gh-pages
Branch to Your Private Repository:
Push thegh-pages
branch to your private repository on GitHub.git push -u origin gh-pages
-
Configure GitHub Pages in Your Private Repository:
- Go to your repository settings on GitHub.
- Navigate to the 'GitHub Pages' section.
- Select the
gh-pages
branch as the source and choose the root folder for the website. - Confirm the changes to activate GitHub Pages.
-
Utilizing Jupyter Book with GitHub Actions:
- The private repository includes a GitHub Actions workflow that automates the building and publishing of the course content using Jupyter Book.
- Before the workflow can run, ensure that Jupyter Book is installed. You can install Jupyter Book by running:
pip install -U jupyter-book
- This workflow takes the course's Jupyter notebooks and wiki, compiles them into a well-structured, navigable format, and then publishes them on GitHub Pages.
- The workflow is set up to run automatically upon updates to the
gh-pages
branch, so no additional steps are needed to initiate this process once Jupyter Book is installed.
-
Regularly Update the
gh-pages
Branch (Optional):
To keep the content current with the public repository:- Fetch updates from the upstream:
git fetch upstream
- Switch to the
gh-pages
branch:git checkout gh-pages
- Merge the latest changes and resolve conflicts if any:
git merge upstream/gh-pages
- Push the updates to your private repository:
git push origin gh-pages
- Fetch updates from the upstream:
Note: Regularly updating the gh-pages
branch ensures that your GitHub Pages site, including the Jupyter Book content, remains synchronized with the latest updates from the public repository.