From c380a570fb3defef1a145ec086ec4b818c020b76 Mon Sep 17 00:00:00 2001
From: avahoffman
Date: Fri, 9 Aug 2024 12:41:54 -0400
Subject: [PATCH 1/8] Make sure output.yml gets a commit
---
.github/workflows/pull_request.yml | 8 +++++++-
_output.yml | 2 +-
config_automation.yml | 3 +++
3 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml
index d4d2515a..577ace03 100644
--- a/.github/workflows/pull_request.yml
+++ b/.github/workflows/pull_request.yml
@@ -48,7 +48,9 @@ jobs:
toggle_style_code: "${{ env.STYLE_CODE }}"
toggle_url_check: "${{ env.URL_CHECKER }}"
toggle_quiz_check: "${{ env.CHECK_QUIZZES }}"
+ toggle_feedback_link: "${{ env.FEEDBACK_LINK }}"
toggle_render_preview: "${{ env.RENDER_PREVIEW }}"
+ toggle_student_guide: "${{ env.RENDER_STUDENT_GUIDE }}"
rendering_docker_image: "${{ env.RENDERING_DOCKER_IMAGE }}"
########################## Make the error reports ##############################
@@ -142,7 +144,11 @@ jobs:
# Make sure the link for AnVIL feedback is prepopulated for the specific course
- name: Set up feedback link
id: feedback
- run: bash scripts/AnVIL_Feedback_Script.sh
+ if: ${{needs.yaml-check.outputs.toggle_feedback_link == 'yes'}}
+ run: |
+ bash scripts/AnVIL_Feedback_Script.sh
+ git add _output.yml
+ git commit -m 'Set up feedback link'
# Run bookdown rendering
- name: Run bookdown render
diff --git a/_output.yml b/_output.yml
index 7d6b017c..7ff6ae59 100644
--- a/_output.yml
+++ b/_output.yml
@@ -18,4 +18,4 @@ bookdown::gitbook:
Style adapted from: rstudio4edu-book (CC-BY 2.0)
-# Note: Do not edit the feedback link in this file. This is automatically edited through the render-preview and render-bookdown workflows.
\ No newline at end of file
+# Note: Do not edit the feedback link in this file. This is automatically edited through the render-preview and render-bookdown workflows. You can deactivate this behavior in config_automation.yml.
\ No newline at end of file
diff --git a/config_automation.yml b/config_automation.yml
index ccc06112..8e28f58d 100644
--- a/config_automation.yml
+++ b/config_automation.yml
@@ -22,6 +22,9 @@ render-coursera: yes
##### Rendering of student guide (if applicable)
render-student-guide: yes
+##### Auto-generate a feedback link for the AnVIL Feedback Form: https://docs.google.com/forms/d/e/1FAIpQLScrDVb_utm55pmb_SHx-RgELTEbCCWdLea0T3IzS0Oj00GE4w/viewform
+feedback-link: yes
+
# What docker image should be used for rendering?
# The default is jhudsl/course_template:main
rendering-docker-image: 'jhudsl/base_ottr:main'
From bd1ea0c32779548c5066f1bfbfd5b1e7a13cd1ac Mon Sep 17 00:00:00 2001
From: avahoffman
Date: Fri, 9 Aug 2024 13:03:22 -0400
Subject: [PATCH 2/8] Fix name
---
.github/workflows/pull_request.yml | 3 ++-
student-guide/_bookdown.yml | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml
index 577ace03..952a1ff7 100644
--- a/.github/workflows/pull_request.yml
+++ b/.github/workflows/pull_request.yml
@@ -216,7 +216,8 @@ jobs:
course_name=$(head -n 1 student-guide/_bookdown.yml | cut -d'"' -f 2| tr " " "-")
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")
- student_docx_link=$(echo "https://github.com/$GITHUB_REPOSITORY/raw/preview-${{ github.event.pull_request.number }}/student-guide/$course_name.docx") zip_link=$(echo "https://github.com/$GITHUB_REPOSITORY/raw/preview-${{ github.event.pull_request.number }}/website-preview.zip")
+ student_docx_link=$(echo "https://github.com/$GITHUB_REPOSITORY/raw/preview-${{ github.event.pull_request.number }}/student-guide/Student_Guide.docx")
+ zip_link=$(echo "https://github.com/$GITHUB_REPOSITORY/raw/preview-${{ github.event.pull_request.number }}/website-preview.zip")
echo "zip_link=$zip_link" >> $GITHUB_OUTPUT
echo "bookdown_link=$bookdown_link" >> $GITHUB_OUTPUT
echo "tocless_link=$tocless_link" >> $GITHUB_OUTPUT
diff --git a/student-guide/_bookdown.yml b/student-guide/_bookdown.yml
index b5ced82d..5c247d77 100644
--- a/student-guide/_bookdown.yml
+++ b/student-guide/_bookdown.yml
@@ -1,4 +1,4 @@
-book_filename: "Course_Name"
+book_filename: "Student_Guide"
chapter_name: "Chapter "
repo: https://github.com/jhudsl/AnVIL_Template/
rmd_files: ["index.Rmd",
From b53f1fcceb061ef625f301e0617ddcb432142edd Mon Sep 17 00:00:00 2001
From: avahoffman
Date: Fri, 9 Aug 2024 13:05:40 -0400
Subject: [PATCH 3/8] Update render all to match
---
.github/workflows/render-all.yml | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/.github/workflows/render-all.yml b/.github/workflows/render-all.yml
index 8bb8ecb3..d6870ff6 100644
--- a/.github/workflows/render-all.yml
+++ b/.github/workflows/render-all.yml
@@ -30,7 +30,8 @@ jobs:
toggle_bookdown: "${{ env.RENDER_BOOKDOWN }}"
toggle_coursera: "${{ env.RENDER_COURSERA }}"
toggle_leanpub: "${{ env.RENDER_LEANPUB }}"
- make_book_txt: "${{ env.MAKE_BOOK_TXT }}"
+ toggle_feedback_link: "${{ env.FEEDBACK_LINK }}"
+ toggle_student_guide: "${{ env.RENDER_STUDENT_GUIDE }}"
rendering_docker_image: "${{ env.RENDERING_DOCKER_IMAGE }}"
toggle_quiz_check: "${{ env.CHECK_QUIZZES }}"
@@ -61,8 +62,11 @@ jobs:
# Make sure the link for AnVIL feedback is prepopulated for the specific course
- name: Set up feedback link
- id: feedback
- run: bash scripts/AnVIL_Feedback_Script.sh
+ if: ${{needs.yaml-check.outputs.toggle_feedback_link == 'yes'}}
+ run: |
+ bash scripts/AnVIL_Feedback_Script.sh
+ git add _output.yml
+ git commit -m 'Set up feedback link'
# Run bookdown rendering
- name: Run bookdown render
From fc42f8cc95f721f5f42304813f21eafc487f1443 Mon Sep 17 00:00:00 2001
From: avahoffman
Date: Fri, 9 Aug 2024 13:12:53 -0400
Subject: [PATCH 4/8] fix download object for docx
---
.github/workflows/pull_request.yml | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml
index 952a1ff7..b84bd309 100644
--- a/.github/workflows/pull_request.yml
+++ b/.github/workflows/pull_request.yml
@@ -216,12 +216,12 @@ jobs:
course_name=$(head -n 1 student-guide/_bookdown.yml | cut -d'"' -f 2| tr " " "-")
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")
- student_docx_link=$(echo "https://github.com/$GITHUB_REPOSITORY/raw/preview-${{ github.event.pull_request.number }}/student-guide/Student_Guide.docx")
+ student_guide=$(echo "https://github.com/$GITHUB_REPOSITORY/raw/preview-${{ github.event.pull_request.number }}/student-guide/Student_Guide.docx")
zip_link=$(echo "https://github.com/$GITHUB_REPOSITORY/raw/preview-${{ github.event.pull_request.number }}/website-preview.zip")
echo "zip_link=$zip_link" >> $GITHUB_OUTPUT
echo "bookdown_link=$bookdown_link" >> $GITHUB_OUTPUT
echo "tocless_link=$tocless_link" >> $GITHUB_OUTPUT
- echo "student_docx_link=$student_docx_link" >> $GITHUB_OUTPUT
+ echo "student_guide=$student_guide" >> $GITHUB_OUTPUT
echo "time=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
echo "commit_id=$GITHUB_SHA" >> $GITHUB_OUTPUT
echo ${{steps.commit.outputs.changes}}
@@ -236,7 +236,7 @@ jobs:
Re-rendered previews from the latest commit:
- :eyes: Quick [preview of course website here](${{ steps.build-components.outputs.bookdown_link }}) \*
- :microscope: Comprehensive [download of the course website here](${{ steps.build-components.outputs.zip_link }})
- - Download the [.docx file](${{ steps.build-components.outputs.docx_link }})
+ - Download the Student Guide [.docx file](${{ steps.build-components.outputs.student_guide }})
\* note not all html features will be properly displayed in the "quick preview" but it will give you a rough idea.
From 26755058f4cea349a8a4c7244defbf13f38d668a Mon Sep 17 00:00:00 2001
From: avahoffman
Date: Fri, 9 Aug 2024 13:13:04 -0400
Subject: [PATCH 5/8] sync more files (for now)
---
.github/sync.yml | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/.github/sync.yml b/.github/sync.yml
index 053695ae..2dc9ab5e 100644
--- a/.github/sync.yml
+++ b/.github/sync.yml
@@ -39,6 +39,10 @@ group:
dest: assets/style.css
- source: assets/toc_close.css
dest: assets/toc_close.css
+ - source: config_automation.yml
+ dest: config_automation.yml
+ - source: student-guide/_bookdown.yml
+ dest: student-guide/_bookdown.yml
# Repositories to receive changes
repos: |
fhdsl/AnVIL_Book_Epigenetics_Intro
From 7ddd146cf3214d0380c3e08548b81b539cf038e2 Mon Sep 17 00:00:00 2001
From: avahoffman
Date: Fri, 9 Aug 2024 13:24:54 -0400
Subject: [PATCH 6/8] Need to commit student guide?
---
.github/workflows/pull_request.yml | 2 ++
1 file changed, 2 insertions(+)
diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml
index b84bd309..8d3f3e54 100644
--- a/.github/workflows/pull_request.yml
+++ b/.github/workflows/pull_request.yml
@@ -169,6 +169,8 @@ jobs:
mv _bookdown.yml _output.yml student-guide
mv tmp1/_bookdown.yml tmp1/_output.yml .
rm -r tmp1
+ git add student-guide/*
+ git commit -m 'Create student guide'
# Run TOC-less version
# Rendered content for Leanpub and Coursera is very similar.
From 054c8ed764fd10f7a91ac07e6166871a189b5548 Mon Sep 17 00:00:00 2001
From: avahoffman
Date: Fri, 9 Aug 2024 13:41:19 -0400
Subject: [PATCH 7/8] Oops yaml obj was wrong
---
.github/workflows/pull_request.yml | 2 +-
.github/workflows/render-all.yml | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml
index 8d3f3e54..5e2ab3ef 100644
--- a/.github/workflows/pull_request.yml
+++ b/.github/workflows/pull_request.yml
@@ -159,7 +159,7 @@ jobs:
# Bookdown does not work well if the files aren't named as such in the
# root directory
- name: Run student guide render
- if: ${{needs.yaml-check.outputs.render_student_guide == 'yes'}}
+ if: ${{needs.yaml-check.outputs.toggle_student_guide == 'yes'}}
id: student_guide
run: |
mkdir tmp1
diff --git a/.github/workflows/render-all.yml b/.github/workflows/render-all.yml
index d6870ff6..74cf10b1 100644
--- a/.github/workflows/render-all.yml
+++ b/.github/workflows/render-all.yml
@@ -79,7 +79,7 @@ jobs:
# Bookdown does not work well if the files aren't named as such in the
# root directory
- name: Run student guide render
- if: ${{needs.yaml-check.outputs.render_student_guide == 'yes'}}
+ if: ${{needs.yaml-check.outputs.toggle_student_guide == 'yes'}}
id: student_guide
run: |
mkdir tmp1
From 6985ece792201136d4307d22b55762aa09b10363 Mon Sep 17 00:00:00 2001
From: avahoffman
Date: Fri, 9 Aug 2024 13:48:58 -0400
Subject: [PATCH 8/8] Forgot to commit on main
---
.github/workflows/render-all.yml | 2 ++
1 file changed, 2 insertions(+)
diff --git a/.github/workflows/render-all.yml b/.github/workflows/render-all.yml
index 74cf10b1..6bfc7aa3 100644
--- a/.github/workflows/render-all.yml
+++ b/.github/workflows/render-all.yml
@@ -89,6 +89,8 @@ jobs:
mv _bookdown.yml _output.yml student-guide
mv tmp1/_bookdown.yml tmp1/_output.yml .
rm -r tmp1
+ git add student-guide/*
+ git commit -m 'Create student guide'
# This checks on the steps before it and makes sure that they completed.
# If the renders didn't complete we don't want to commit the file changes