Skip to content

Commit

Permalink
Merge pull request #221 from jhudsl/feedback-link
Browse files Browse the repository at this point in the history
Make sure output.yml gets a commit
  • Loading branch information
avahoffman authored Aug 9, 2024
2 parents 6f3c203 + 6985ece commit 3da6caf
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 11 deletions.
4 changes: 4 additions & 0 deletions .github/sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
19 changes: 14 additions & 5 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 ##############################
Expand Down Expand Up @@ -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
Expand All @@ -153,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
Expand All @@ -163,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.
Expand Down Expand Up @@ -210,11 +218,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/$course_name.docx") zip_link=$(echo "https://github.com/$GITHUB_REPOSITORY/raw/preview-${{ github.event.pull_request.number }}/website-preview.zip")
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}}
Expand All @@ -229,7 +238,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.
Expand Down
14 changes: 10 additions & 4 deletions .github/workflows/render-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"

Expand Down Expand Up @@ -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
Expand All @@ -75,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
Expand All @@ -85,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
Expand Down
2 changes: 1 addition & 1 deletion _output.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ bookdown::gitbook:
<p style="text-align:center; font-size: 12px;"> <a href="https://github.com/rstudio4edu/rstudio4edu-book/"> Style adapted from: rstudio4edu-book </a> <a href ="https://creativecommons.org/licenses/by/2.0/"> (CC-BY 2.0) </a></p>
<p style="padding-left: 40px;"><div class="trapezoid" style = "padding-left: 40px;"><span><a href="https://docs.google.com/forms/d/e/1FAIpQLScrDVb_utm55pmb_SHx-RgELTEbCCWdLea0T3IzS0Oj00GE4w/viewform?usp=pp_url&entry.1565230805=your+course"> Click here to provide feedback</a> <img src="assets/itcr_arrow.png" style=" width: 10%" ></span></div></p>
# Note: Do not edit the feedback link in this file. This is automatically edited through the render-preview and render-bookdown workflows.
# 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.
3 changes: 3 additions & 0 deletions config_automation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
2 changes: 1 addition & 1 deletion student-guide/_bookdown.yml
Original file line number Diff line number Diff line change
@@ -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",
Expand Down

0 comments on commit 3da6caf

Please sign in to comment.