Compartmentalized | Documented | Extendible | Reproducible | Robust |
Key GitHub.com skills.
Pro tip checkout the state of the repository at the time of a release. From the terminal:
git checkout v1.0
When done:
git switch -
Warning git checkout ...
will change all your time stamps.
I develop on the main branch as long as I can break work into small tasks. The versions that users use are either CRAN releases or GitHub releases. I warn them that the main branch is a development branch and might be broken.
A major re-organization or new functionality that has the potential to break things is done on a branch.
I use this to organize collections of repositories. Example: https://github.com/eeholmes
You may have heard about them. Let’s see it in action. We make a GitHub Action that will update our Readme file whenever a relevant change happens. We’ll see a bigger example next week with RMarkdown reports.
To set up our action:
render-readme.yml
with the instructions for what to do to make the Readme.md file.Our yml file has a set of instructions to the server that is going to do the work.
on:
push:
paths:
- README.Rmd
- test.csv
name: Render README
jobs:
render:
name: Render README
runs-on: macOS-latest
steps:
- uses: actions/checkout@v2
- uses: r-lib/actions/setup-r@v1
- uses: r-lib/actions/setup-pandoc@v1
- name: Install packages
run: Rscript -e 'install.packages(c("rmarkdown", "knitr"))'
- name: Render README
run: Rscript -e 'rmarkdown::render("README.Rmd", output_format = "md_document")'
- name: Commit results
run: |
git commit README.md -m 'Re-build README.Rmd' || echo "No changes to commit"
git push origin || echo "No changes to commit"