diff --git a/.github/workflows/delete-preview.yml b/.github/workflows/delete-preview.yml
index 88dc705..faa83cc 100644
--- a/.github/workflows/delete-preview.yml
+++ b/.github/workflows/delete-preview.yml
@@ -18,7 +18,7 @@ jobs:
# Check out current repository
- name: checkout
- uses: actions/checkout@v2
+ uses: actions/checkout@v4
with:
fetch-depth: 0
diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml
index 6bebd6b..c58b39a 100644
--- a/.github/workflows/pull_request.yml
+++ b/.github/workflows/pull_request.yml
@@ -1,4 +1,5 @@
-# Candace Savonen Aug 2022
+# Candace Savonen 2021
+# Updated Jan 2023
name: Pull Request
@@ -13,9 +14,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
- uses: actions/checkout@v2
+ uses: actions/checkout@v4
with:
fetch-depth: 0
+ token: ${{ secrets.GH_PAT }}
# Use the yaml-env-action action.
- name: Load environment from YAML
@@ -23,14 +25,6 @@ jobs:
with:
files: config_automation.yml # Pass a space-separated list of configuration files. Rightmost files take precedence.
- - name: Verify Dockerfiles changed?
- uses: tj-actions/verify-changed-files@v8.8
- id: verify-changed-files
- with:
- files: |
- docker/Dockerfile
- docker/github_package_list.tsv
-
# Delete the branch if this has been run before
- name: Delete branch locally and remotely
run: git push origin --delete preview-${{ github.event.pull_request.number }} || echo "No branch to delete"
@@ -38,8 +32,9 @@ jobs:
# Make the branch fresh
- name: Make the branch fresh
run: |
- git config --local user.email "itcrtrainingnetwork@gmail.com"
- git config --local user.name "jhudsl-robot"
+ git config --global --add safe.directory $GITHUB_WORKSPACE
+ git config --global user.email "itcrtrainingnetwork@gmail.com"
+ git config --global user.name "jhudsl-robot"
branch_name='preview-${{ github.event.pull_request.number }}'
echo branch doesnt exist
@@ -47,15 +42,14 @@ jobs:
git push --set-upstream origin $branch_name
shell: bash
+
outputs:
toggle_spell_check: "${{ env.SPELL_CHECK }}"
toggle_style_code: "${{ env.STYLE_CODE }}"
toggle_url_check: "${{ env.URL_CHECKER }}"
toggle_quiz_check: "${{ env.CHECK_QUIZZES }}"
toggle_render_preview: "${{ env.RENDER_PREVIEW }}"
- toggle_docker_build: "${{ env.DOCKER_BUILD }}"
rendering_docker_image: "${{ env.RENDERING_DOCKER_IMAGE }}"
- dockerfiles_changed: steps.verify-changed-files.outputs.files_changed
########################## Make the error reports ##############################
spell-check:
@@ -67,6 +61,7 @@ jobs:
check_type: spelling
error_min: 3
gh_pat: secrets.GH_PAT
+ branch_name: ${GITHUB_HEAD_REF}
url-check:
name: Check URLs
@@ -77,6 +72,7 @@ jobs:
check_type: urls
error_min: 0
gh_pat: secrets.GH_PAT
+ branch_name: ${GITHUB_HEAD_REF}
quiz-check:
name: Check quiz formatting
@@ -87,6 +83,7 @@ jobs:
check_type: quiz_format
error_min: 0
gh_pat: secrets.GH_PAT
+ branch_name: ${GITHUB_HEAD_REF}
############################# Style the code ###################################
style-code:
@@ -99,7 +96,7 @@ jobs:
steps:
- name: Checkout files
- uses: actions/checkout@v2
+ uses: actions/checkout@v4
with:
fetch-depth: 0
@@ -108,6 +105,7 @@ jobs:
- name: Commit styled files
run: |
+ git config --system --add safe.directory "$GITHUB_WORKSPACE"
git add \*.Rmd
git commit -m 'Style Rmds' || echo "No changes to commit"
git push origin || echo "No changes to commit"
@@ -124,15 +122,16 @@ jobs:
steps:
- name: Checkout files
- uses: actions/checkout@v2
+ uses: actions/checkout@v4
with:
fetch-depth: 0
# Set up git checkout
- name: Set up git checkout
run: |
- git config --local user.email "itcrtrainingnetwork@gmail.com"
- git config --local user.name "jhudsl-robot"
+ git config --global --add safe.directory $GITHUB_WORKSPACE
+ git config --global user.email "itcrtrainingnetwork@gmail.com"
+ git config --global user.name "jhudsl-robot"
branch_name='preview-${{ github.event.pull_request.number }}'
git fetch --all
@@ -167,7 +166,7 @@ jobs:
run: |
branch_name='preview-${{ github.event.pull_request.number }}'
git diff origin/main -- docs >/dev/null && changes=true || changes=false
- echo ::set-output name=changes::$changes
+ echo "changes=$changes" >> $GITHUB_OUTPUT
git add . --force
git commit -m 'Render preview' || echo "No changes to commit"
git pull --set-upstream origin $branch_name --allow-unrelated-histories --strategy-option=ours
@@ -175,7 +174,7 @@ jobs:
shell: bash
- name: Find Comment
- uses: peter-evans/find-comment@v1
+ uses: peter-evans/find-comment@v2
id: fc
with:
issue-number: ${{ github.event.pull_request.number }}
@@ -189,16 +188,16 @@ jobs:
bookdown_link=$(echo "https://htmlpreview.github.io/?https://raw.githubusercontent.com/$GITHUB_REPOSITORY/preview-${{ github.event.pull_request.number }}/docs/index.html")
tocless_link=$(echo "https://htmlpreview.github.io/?https://raw.githubusercontent.com/$GITHUB_REPOSITORY/preview-${{ github.event.pull_request.number }}/docs/no_toc/index.html")
docx_link=$(echo "https://github.com/$GITHUB_REPOSITORY/raw/preview-${{ github.event.pull_request.number }}/docs/$course_name.docx")
- echo ::set-output name=bookdown_link::$bookdown_link
- echo ::set-output name=tocless_link::$tocless_link
- echo ::set-output name=docx_link::$docx_link
- echo ::set-output name=time::$(date +'%Y-%m-%d')
- echo ::set-output name=commit_id::$GITHUB_SHA
+ echo "bookdown_link=$bookdown_link" >> $GITHUB_OUTPUT
+ echo "tocless_link=$tocless_link" >> $GITHUB_OUTPUT
+ echo "docx_link=$docx_link" >> $GITHUB_OUTPUT
+ echo "time=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
+ echo "commit_id=$GITHUB_SHA" >> $GITHUB_OUTPUT
echo ${{steps.commit.outputs.changes}}
- name: Create or update comment
if: steps.commit.outputs.changes == 'true'
- uses: peter-evans/create-or-update-comment@v1
+ uses: peter-evans/create-or-update-comment@v2
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
@@ -213,7 +212,7 @@ jobs:
- name: Comment if no changes
if: steps.commit.outputs.changes == 'false'
- uses: peter-evans/create-or-update-comment@v1
+ uses: peter-evans/create-or-update-comment@v2
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
@@ -222,56 +221,3 @@ jobs:
_Updated at ${{ steps.build-components.outputs.time }} with changes from ${{ steps.build-components.outputs.commit_id }}_
edit-mode: replace
-
-############################## Build Docker ####################################
-
- build-docker:
- name: Build Docker image
- needs: yaml-check
- runs-on: ubuntu-latest
- if: ${{needs.yaml-check.outputs.toggle_docker_build == 'yes' && needs.yaml-check.outputs.dockerfiles_changed == 'true' && github.head_ref != 'repo-sync/OTTR_Template/default'}}
-
- steps:
- - name: checkout repo
- uses: actions/checkout@v2
-
- - name: Verify Dockerfiles changed?
- uses: tj-actions/verify-changed-files@v8.8
- id: verify-changed-files
- with:
- files: |
- docker/Dockerfile
- docker/github_package_list.tsv
-
- - name: Login as jhudsl-robot
- run: |
- git config --local user.email "itcrtrainingnetwork@gmail.com"
- git config --local user.name "jhudsl-robot"
-
- # Set up Docker build
- - name: Set up Docker Buildx
- uses: docker/setup-buildx-action@v1
-
- # Setup layer cache
- - name: Cache Docker layers
- uses: actions/cache@v2
- with:
- path: /tmp/.buildx-cache
- key: ${{ runner.os }}-buildx-${{ github.sha }}
- restore-keys: |
- ${{ runner.os }}-buildx-
-
- - name: Set up Docker Build
- uses: docker/setup-buildx-action@v1
-
- - name: Get token
- run: echo ${{ secrets.GH_PAT }} > docker/git_token.txt
-
- - name: Build Docker image
- uses: docker/build-push-action@v2
- with:
- push: false
- load: true
- context: docker
- file: docker/Dockerfile
- tags: jhudsl/base_ottr
diff --git a/.github/workflows/render-all.yml b/.github/workflows/render-all.yml
index 407e1ca..7810e38 100644
--- a/.github/workflows/render-all.yml
+++ b/.github/workflows/render-all.yml
@@ -10,6 +10,7 @@ on:
paths:
- '**.Rmd'
- assets/*
+ - quizzes/*
jobs:
@@ -18,7 +19,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
- uses: actions/checkout@v2
+ uses: actions/checkout@v4
# Use the yaml-env-action action.
- name: Load environment from YAML
@@ -29,6 +30,7 @@ jobs:
toggle_bookdown: "${{ env.RENDER_BOOKDOWN }}"
toggle_coursera: "${{ env.RENDER_COURSERA }}"
toggle_leanpub: "${{ env.RENDER_LEANPUB }}"
+ make_book_txt: "${{ env.MAKE_BOOK_TXT }}"
rendering_docker_image: "${{ env.RENDERING_DOCKER_IMAGE }}"
toggle_quiz_check: "${{ env.CHECK_QUIZZES }}"
@@ -42,16 +44,16 @@ jobs:
steps:
- name: checkout
- uses: actions/checkout@v2
+ uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GH_PAT }}
- name: Login as jhudsl-robot
run: |
-
- git config --local user.email "itcrtrainingnetwork@gmail.com"
- git config --local user.name "jhudsl-robot"
+ git config --global --add safe.directory $GITHUB_WORKSPACE
+ git config --global user.email "itcrtrainingnetwork@gmail.com"
+ git config --global user.name "jhudsl-robot"
# We want a fresh run of the renders each time
- name: Delete old docs/*
@@ -78,10 +80,11 @@ jobs:
GH_PAT: ${{ secrets.GH_PAT }}
run: |
git remote set-url origin https://${GH_PAT}@github.com/${GITHUB_REPOSITORY}
+ git fetch origin
git add --force docs/*
git commit -m 'Render bookdown' || echo "No changes to commit"
git pull --allow-unrelated-histories --strategy-option=ours
- git push origin main || echo "No changes to push"
+ git push -u origin main || echo "No changes to push"
render-tocless:
name: Render TOC-less version for Leanpub or Coursera
@@ -93,15 +96,16 @@ jobs:
steps:
- name: checkout
- uses: actions/checkout@v2
+ uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GH_PAT }}
- name: Login as jhudsl-robot
run: |
- git config --local user.email "itcrtrainingnetwork@gmail.com"
- git config --local user.name "jhudsl-robot"
+ git config --global --add safe.directory $GITHUB_WORKSPACE
+ git config --global user.email "itcrtrainingnetwork@gmail.com"
+ git config --global user.name "jhudsl-robot"
# Rendered content for Leanpub and Coursera is very similar.
# This job creates a shared scaffold for both.
@@ -115,10 +119,11 @@ jobs:
GH_PAT: ${{ secrets.GH_PAT }}
run: |
git remote set-url origin https://${GH_PAT}@github.com/${GITHUB_REPOSITORY}
+ git fetch origin
git add --force docs/no_toc*
git commit -m 'Render toc-less' || echo "No changes to commit"
git pull --allow-unrelated-histories --strategy-option=ours
- git push origin main || echo "No changes to push"
+ git push -u origin main || echo "No changes to push"
render-leanpub:
name: Finish Leanpub prep
@@ -130,15 +135,16 @@ jobs:
steps:
- name: checkout
- uses: actions/checkout@v2
+ uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GH_PAT }}
- name: Login as jhudsl-robot
run: |
- git config --local user.email "itcrtrainingnetwork@gmail.com"
- git config --local user.name "jhudsl-robot"
+ git config --global --add safe.directory $GITHUB_WORKSPACE
+ git config --global user.email "itcrtrainingnetwork@gmail.com"
+ git config --global user.name "jhudsl-robot"
# Create screenshots
- name: Run the screenshot creation
@@ -153,8 +159,17 @@ jobs:
--output_dir resources/chapt_screen_images)
# We want a fresh run of the renders each time
- - name: Delete old manuscript/
- run: rm -rf manuscript/
+ - name: Delete manuscript/
+ env:
+ GH_PAT: ${{ secrets.GH_PAT }}
+ run: |
+ rm -rf manuscript/
+ git remote set-url origin https://${GH_PAT}@github.com/${GITHUB_REPOSITORY}
+ git fetch origin
+ git add .
+ git commit -m 'Delete manuscript folder' || echo "No changes to commit"
+ git pull --allow-unrelated-histories --strategy-option=ours
+ git push -u origin main || echo "No changes to push"
- name: Run ottrpal::bookdown_to_embed_leanpub
if: needs.yaml-check.outputs.toggle_quiz_check == 'no'
@@ -162,7 +177,7 @@ jobs:
Rscript -e "ottrpal::bookdown_to_embed_leanpub(
render = FALSE, \
chapt_img_key = 'resources/chapt_screen_images/chapter_urls.tsv', \
- make_book_txt = TRUE, \
+ make_book_txt = as.logical('${{needs.yaml-check.outputs.make_book_txt}}'), \
quiz_dir = NULL)"
- name: Run ottrpal::bookdown_to_embed_leanpub
@@ -171,20 +186,20 @@ jobs:
Rscript -e "ottrpal::bookdown_to_embed_leanpub(
render = FALSE, \
chapt_img_key = 'resources/chapt_screen_images/chapter_urls.tsv', \
- make_book_txt = TRUE)"
+ make_book_txt = as.logical('${{needs.yaml-check.outputs.make_book_txt}}'))"
# Commit the rendered Leanpub files
- name: Commit rendered Leanpub files
env:
GH_PAT: ${{ secrets.GH_PAT }}
run: |
- git remote set-url origin https://${GH_PAT}@github.com/${GITHUB_REPOSITORY}
+ mkdir -p manuscript
git add --force manuscript/*
git add --force resources/*
git add --force docs/*
git commit -m 'Render Leanpub' || echo "No changes to commit"
git pull --allow-unrelated-histories --strategy-option=ours
- git push origin main || echo "No changes to push"
+ git push --force --set-upstream origin main || echo "No changes to push"
render-coursera:
name: Finish Coursera prep
@@ -196,15 +211,16 @@ jobs:
steps:
- name: checkout
- uses: actions/checkout@v2
+ uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GH_PAT }}
- name: Login as jhudsl-robot
run: |
- git config --local user.email "itcrtrainingnetwork@gmail.com"
- git config --local user.name "jhudsl-robot"
+ git config --global --add safe.directory $GITHUB_WORKSPACE
+ git config --global user.email "itcrtrainingnetwork@gmail.com"
+ git config --global user.name "jhudsl-robot"
# Run Coursera version
- name: Convert Leanpub quizzes to Coursera
@@ -218,9 +234,10 @@ jobs:
GH_PAT: ${{ secrets.GH_PAT }}
run: |
git remote set-url origin https://${GH_PAT}@github.com/${GITHUB_REPOSITORY}
+ git fetch origin
git add --force manuscript/*
git add --force resources/*
git add --force docs/*
git commit -m 'Render Coursera quizzes' || echo "No changes to commit"
git pull --allow-unrelated-histories --strategy-option=ours
- git push origin main || echo "No changes to push"
+ git push -u origin main || echo "No changes to push"
diff --git a/.github/workflows/transfer-rendered-files.yml b/.github/workflows/transfer-rendered-files.yml
index df91b77..e698d98 100644
--- a/.github/workflows/transfer-rendered-files.yml
+++ b/.github/workflows/transfer-rendered-files.yml
@@ -21,7 +21,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
- uses: actions/checkout@v2
+ uses: actions/checkout@v4
# Use the yaml-env-action action.
- name: Load environment from YAML
@@ -60,12 +60,12 @@ jobs:
results=$(Rscript --vanilla git_repo_check.R --repo "$GITHUB_REPOSITORY" --git_pat "$GH_PAT")
echo $QUIZ_REPO exists: $results
- echo "::set-output name=git_results::$results"
- echo "::set-output name=leanpub_repo::$QUIZ_REPO"
+ echo "git_results=$results" >> $GITHUB_OUTPUT
+ echo "leanpub_repo=$QUIZ_REPO" >> $GITHUB_OUTPUT
- name: Checkout code from Leanpub repo
if: ${{ steps.git_repo_check.outputs.git_results == 'TRUE' }}
- uses: actions/checkout@v2
+ uses: actions/checkout@v4
with:
repository: ${{ steps.git_repo_check.outputs.leanpub_repo }}
token: ${{ secrets.GH_PAT }}
@@ -79,9 +79,9 @@ jobs:
# Copy over images folder
svn export --force https://github.com/${GITHUB_REPOSITORY}.git/branches/${GITHUB_REF#refs/heads/}/resources/chapt_screen_images resources/chapt_screen_images
- # Copy over _bookdown.yml
+ # Copy over _bookdown.yml
svn export --force https://github.com/${GITHUB_REPOSITORY}.git/branches/${GITHUB_REF#refs/heads/}/_bookdown.yml _bookdown.yml
-
+
- name: Create PR with resources files
if: ${{ steps.git_repo_check.outputs.git_results == 'TRUE' }}
uses: peter-evans/create-pull-request@v3
diff --git a/03-version-control-with-github.Rmd b/03-version-control-with-github.Rmd
index 8540e11..442eaf0 100644
--- a/03-version-control-with-github.Rmd
+++ b/03-version-control-with-github.Rmd
@@ -33,7 +33,7 @@ GitKraken is nice because they have lots of nice tutorials, it works pretty well
### Install GitKraken
-[Go here to install GitKraken](https://support.gitkraken.com/how-to-install/).
+[Go here to install GitKraken](https://www.gitkraken.com/).
Follow their instructions to sign in with your GitHub account. It will ask you to authorize your GitHub account to connect to GitKraken. Click `Authorize`.
@@ -77,7 +77,7 @@ mkdir -p chapter-zips
wget -O chapter-zips/reproducible-python-example.zip https://raw.githubusercontent.com/jhudsl/Reproducibility_in_Cancer_Informatics/main/chapter-zips/reproducible-python-example.zip
```
-Now double click your chapter zip file to unzip. For Windows you may have to [follow these instructions](https://support.microsoft.com/en-us/windows/zip-and-unzip-files-f6dde0a7-0fec-8294-e1d3-703ed85e7ebc)).
+Now double click your chapter zip file to unzip. For Windows you may have to [follow these instructions](https://support.microsoft.com/en-us/windows/zip-and-unzip-files-f6dde0a7-0fec-8294-e1d3-703ed85e7ebc).
```{bash, include = FALSE}
unzip -o chapter-zips/reproducible-python-example.zip -d chapter-zips/
@@ -92,7 +92,7 @@ mkdir -p chapter-zips
wget -O chapter-zips/reproducible-R-example.zip https://raw.githubusercontent.com/jhudsl/Reproducibility_in_Cancer_Informatics/main/chapter-zips/reproducible-R-example.zip
```
-Now double click your chapter zip file to unzip. For Windows you may have to [follow these instructions](https://support.microsoft.com/en-us/windows/zip-and-unzip-files-f6dde0a7-0fec-8294-e1d3-703ed85e7ebc)).
+Now double click your chapter zip file to unzip. For Windows you may have to [follow these instructions](https://support.microsoft.com/en-us/windows/zip-and-unzip-files-f6dde0a7-0fec-8294-e1d3-703ed85e7ebc).
```{bash, include = FALSE}
unzip -o chapter-zips/reproducible-R-example.zip -d chapter-zips/
@@ -246,7 +246,7 @@ ottrpal::include_slide("https://docs.google.com/presentation/d/1IJ_uFxJud7OdIAr6
## More resources for learning GitHub
-- [Happy Git and GitHub for the useR](https://happygitwithr.com/) by @Bryan2021.
+- [Happy Git and GitHub for the useR](https://happygitwithr.com) by @Bryan2021.
- [GitHub for data scientists](https://towardsdatascience.com/introduction-to-github-for-data-scientists-2cf8b9b25fba) by @Vickery2019.
- [Intro to GitHub](https://github.com/skills/introduction-to-github) by @GitHub2022.
- [First Day on GitHub](https://skills.github.com/#first-day-on-github) by @GitHub2022c.
diff --git a/04-data-handling.Rmd b/04-data-handling.Rmd
index ee11539..1747944 100644
--- a/04-data-handling.Rmd
+++ b/04-data-handling.Rmd
@@ -38,7 +38,7 @@ wget -h
wget -O To run your new **Python docker image**
But replace `image_name` with whatever you have called your image.
diff --git a/assets/box_images/under_construction.png b/assets/box_images/under_construction.png
new file mode 100644
index 0000000..a67bd5c
Binary files /dev/null and b/assets/box_images/under_construction.png differ
diff --git a/resources/exclude_files.txt b/resources/exclude_files.txt
new file mode 100644
index 0000000..0e6200f
--- /dev/null
+++ b/resources/exclude_files.txt
@@ -0,0 +1,7 @@
+About.Rmd
+docs/*
+style-sets/*
+manuscript/*
+LICENSE.md
+README.md
+code_of_conduct.md
diff --git a/style-sets/fhdasl/_output.yml b/style-sets/fhdasl/_output.yml
index 353e612..d00716f 100644
--- a/style-sets/fhdasl/_output.yml
+++ b/style-sets/fhdasl/_output.yml
@@ -3,14 +3,15 @@ bookdown::gitbook:
includes:
before_body: assets/big-image_fhdasl.html
after_body: assets/footer.html
+ split_bib: false
highlight: tango
config:
toc:
collapse: section
before: |
-
+
after: |
-
-
+
+