Appendix B — GitHub Setup

Steps to setting up this GitHub Repository

B.1 Created a new repository on GitHub

  1. Logged into GitHub and clicked on the “Create new…” icon
  2. Selected “New repository” and specified owner, name, and description
  3. Chose public visibility, turned on README, and added the R .gitignore template
  4. Clicked on Create new repository, then copied the repository URL

B.2 Cloned to a local directory and set up repository as an R project

  1. Cloned repository with RStudio to create an associated .Rproj file by navigating to File > New Project > Version Control > Git and then pasting the repository URL
  2. Staged, committed, and pushed the new .Rproj file

B.3 Prepared use of Quarto in the repository

  1. Added a new line for /.quarto/ to the .gitignore to ignore temporary files generated during the rendering process and remove the line that ignores docs/
  2. Created a simple _quarto.yml and index.qmd files
  3. Staged, committed, and pushed the 2 new files and the changes to the .gitignore file

B.4 Rendered html and pdf

  1. Restarted RStudio for the Build tab to appear
  2. In the build tab, selected Render Book > All Formats
  3. Staged, committed, and pushed the new docs folder

B.5 Configured GitHub pages

  1. Navigated to Pages in the Repository settings on GitHub
  2. Selected and saved the main Branch and /docs folder as the source
  3. Refreshed the browser and copied the URL

B.6 Created a new chapter in the book

  1. Created a new quarto file called github.qmd in the R Studio project
  2. Added the name of the new GitHub quarto file to the _quarto.yml list of chapters
  3. In the build tab, selected Render Book > All Formats
  4. Staged, committed, and pushed the new github.qmd file along with the updated /docs and _quarto.yml file

B.7 Protected the main branch and required all future changes to be submitted via pull requests

  1. Configured required use of pull requests to prevent future merge conflicts by navigating to Settings > Branches > Add classic branch protection rule and then specifying the branch name pattern “main” along with selecting “Require a pull request before merging”

B.8 Prepare the repository to run python when engine is specified as jupyter

  1. Download python
  2. Set a Default Python Interpreter in RStudio
  3. Install Jupyter Kernel and the PyYAML via terminal: pip install PyYAML
  4. Install Jupyter Kernel via termina: pip install jupyter
  5. Install libraries via termina: pip install numpy pandas matplotlib seaborn
  6. Create a test_python.qmd file, include: engine: jupyter

B.9 Set up a github action to automatically render the project’s html and pdf files