Setup GitHub pages for private fork - AST-Course/AST5110 GitHub Wiki

Setting Up GitHub Pages on a Private Repository

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:

  1. Clone the gh-pages Branch Locally:
    Create a local gh-pages branch that tracks the gh-pages branch from the upstream public repository.

    git checkout -b gh-pages upstream/gh-pages
  2. Push the gh-pages Branch to Your Private Repository:
    Push the gh-pages branch to your private repository on GitHub.

    git push -u origin gh-pages
  3. 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.
  4. 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.
  5. 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

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.

⚠️ **GitHub.com Fallback** ⚠️