-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Staging branch with what's in main (#438)
* Return to pre-gist method of spell check (#409) * Return to pre-gist method of spell check * Get rid of gist stuff on delete-preview too * Temporarily add spelling errors to test * Commit before testing * Switch to use -z * Fix git diff step * Just look at the local main since it should be up to date * make it simple * Get rid of double bracket * No brackets? * Revert "Temporarily add spelling errors to test" This reverts commit 9e9a932. * Update screenshot for new repo (#410) * Update template button screenshot (#411) * Update screenshot for new repo * Update template button too * See if `fetch-depth: 0` fixes the shallow problem (#412) * Update screenshot for new repo * Update template button too * fetch it all * Switch to devtools::session_info() * Render bookdown * Update screenshot for git-secret.png (#414) * Update screenshot for git-secret.png * Crop off irrelevant git secrets * syntax updates * Needed a semicolon * Fix branch handling * Update spell check set up * Update main * add brackets * set shell intentionally * fix if statements * Create PR if it can't push directly * Make sure it merges * Alter branch test * quote the 0? * switch to -z * Delete extra then * This should work * Change to preview- again whoops * Add a push step * Update starting course * set upstream * Set to bash intentionally (#419) * set to bash * Update * no workflow dispatch * Test leanpub from here (#420) * Test leanpub from here * Update comments * Add check quizzes too * Couple edits * Shut them off for now * Update comments * Render leanpub * Minor polishing of steps (#421) * Test leanpub from here * Update comments * Add check quizzes too * Couple edits * Shut them off for now * Update comments * Note which places needed to be uncommented * Just making the step clearer * Add a git fetch * Add quizzes to spell check * Update README.md * Render leanpub * Add new repository to sync * Polish Examples in Rmds (#426) * Echo false in examples * Updating wiki * Render bookdown * Render bookdown (#427) * Prep for ottr rename (#428) * Render bookdown * Make docker unfail (#431) * Make docker not fail * Add Dockerfile example * Get rid of extra line * Skip build for this test * comment out push part too for this test * undo test Dockerfile * Render bookdown * Try out screenshot creator as a part of the new Leanpub set up (#422) * Try out screenshot creator * Fix spacing * Get rid of typo * fix argument spec * Fix git pat handling * Add copy over assets step * Try this * Try installing just the packages we need * Add install of remotes * Try using devtools instead * try set environ * Try to install R first * Add prereqs * Try rocker r-base * Put installations in script * Try different strategy * Switch to tidyverse * Make directory in bash * I guess I'm making this its own docker image * This isn't working but I want it in case I come back to it * Switch to wkhtmltopdf * Lets' try it * Trying leanbuild steps on their own dockerfile * Test build of leanbuild docker image * Try out webshot r package * fix file path to script * Oh. Actually fix it * Try installing webshot::install_phantomjs * Try installing phantomjs on its own first * Set this up * Build from jhudsl/course_template * Switch back to main dockerfile * assets problem * It works! * Revert "assets problem" This reverts commit 2aada9b. * Add markdown maker basics * Push this version before I delete things * Clean up * Delete the pdfs * Reconfig with latest ottr package changes * Turn on render again * Add PR instead * Move copying step * Add an :: that was missing * Fix arguments for getting pages url * misplaced quotes * Add make_book_txt = TRUE * It's working! Undo the commenting part * Set base to main * Revert "It's working! Undo the commenting part" This reverts commit 92e5081. * rm manuscript folder * Just commit to main * Delete old manuscript files * Copy over assets * Render bookdown * Remove manuscript if it is there * Set group and user id to get rid of permissions probs * Forgot \ 's * Render bookdown * Make it force push * only force manuscript dir * Render Leanpub * Render Leanpub * Render Leanpub * Add to transfer PRs * Delete manuscript folder * Add to sync.yml * Render Leanpub * Remove _Template bit * Add coursera bit and _Quizzes * Clean out manuscript folder when starting new course * Make transfers go to the right folder * add / * Update sync.yml with OTTR_Template_Website (#437) Co-authored-by: jhudsl-robot <itcrtrainingnetwork@gmail.com> Co-authored-by: GitHub Actions <actions@github.com> Co-authored-by: jhudsl-robot <97678365+jhudsl-robot@users.noreply.github.com> Co-authored-by: Tiffany Miller <tiffanym@broadinstitute.org> Co-authored-by: jhudsl-robot <itcrtrainingnetwork@gmail.com>
- Loading branch information
1 parent
99cc9ff
commit 7d85450
Showing
116 changed files
with
1,988 additions
and
587 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,23 @@ | ||
|
||
For more information on these settings see instructions in the [getting started GitHub wiki pages](https://github.com/jhudsl/OTTR_Template/wiki/Setting-up-your-repository-settings). | ||
|
||
### Needed settings: | ||
For more information on these settings see instructions in the [getting started GitHub wiki pages](https://github.com/jhudsl/OTTR_Template/wiki/Start-a-new-course). | ||
|
||
- [ ] This course repository is set to `public`. | ||
- [ ] [Add the `jhudsl-robot` as a collaborator to your repository.](https://github.com/jhudsl/OTTR_Template/wiki/Setting-up-your-repository-settings#add-jhudsl-robot-as-a-collaborator). | ||
- [ ] [GH_PAT has been set up as a GitHub secret](https://github.com/jhudsl/OTTR_Template/wiki/Start-a-new-course#6-set-up-your-github-personal-access-token) | ||
|
||
#### Turn on GitHub pages | ||
- [ ] Go to `Settings` > `Pages`. Underneath `Source`, choose `main` for the branch and select the `docs` folder. Then click `Save`. | ||
- [ ] Check `Enforce HTTPS`. | ||
- [ ] GitHub pages is turned on | ||
- [ ] Go to `Settings` > `Pages`. Underneath `Source`, choose `main` for the branch and select the `docs` folder. Then click `Save`. | ||
- [ ] Check `Enforce HTTPS`. | ||
|
||
#### Set protections for main branch | ||
\* Don't set these settings right away! Wait a few minutes after starting your repository. | ||
- [ ] [Github secret `GH_PAT` has been set](https://github.com/jhudsl/OTTR_Template/wiki/Start-a-new-course#6-set-up-your-github-personal-access-token) | ||
`Name`: `GH_PAT` | ||
`value`: A personal access token [following these instructions](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token#creating-a-token). | ||
Underneath `Select scopes`, check both `repo` and `workflow`. | ||
Then copy the PAT and save as the value. | ||
|
||
- [ ] `main` branch has been set up: | ||
- [ ] `Require pull request reviews before merging` box is checked. | ||
- [ ] `Require status checks to pass before merging` box is checked. | ||
- [ ] Underneath that `Require branches to be up to date before merging` box is checked. | ||
- [ ] Click `Save` at the bottom of the page! | ||
- [ ] [Set branch protections settings](https://github.com/jhudsl/OTTR_Template/wiki/Start-a-new-course#9-set-up-branch-rules) | ||
- [ ] `main` branch has been set up: | ||
- [ ] `Require pull request reviews before merging` box is checked. | ||
- [ ] `Require status checks to pass before merging` box is checked. | ||
- [ ] Underneath that `Require branches to be up to date before merging` box is checked. | ||
- [ ] Click `Save` at the bottom of the page! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
|
||
# Candace Savonen Jan 2022 | ||
|
||
name: Check Leanpub Quizzes | ||
|
||
on: | ||
workflow_dispatch: | ||
### UNCOMMENT THIS SECTION IF YOU WISH PREPARE YOUR COURSE QUIZZES FOR LEANPUB AUTOMATICALLY | ||
# pull_request: | ||
# branches: [ main, staging] | ||
# paths: | ||
# - 'quizzes/*' | ||
######### END OF SECTION ######### | ||
|
||
jobs: | ||
check-quizzes: | ||
runs-on: ubuntu-latest | ||
container: | ||
image: jhudsl/course_template | ||
|
||
steps: | ||
- name: Checkout files | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Configure git | ||
run: | | ||
git config --local user.email "itcrtrainingnetwork@gmail.com" | ||
git config --local user.name "jhudsl-robot" | ||
branch_name='check-${{ github.event.pull_request.number }}' | ||
exists=$(git ls-remote https://${{ secrets.GH_PAT }}@github.com/$GITHUB_REPOSITORY $branch_name | wc -l | xargs) | ||
if [[ $exists == 0 ]];then | ||
echo branch doesnt exist | ||
git checkout -b $branch_name | ||
git push --set-upstream origin $branch_name | ||
else | ||
echo branch does exist | ||
git fetch --all | ||
git checkout $branch_name | ||
git merge -s recursive --strategy-option=theirs origin/${{ github.head_ref }} | ||
fi | ||
shell: bash | ||
|
||
- name: Run quiz check | ||
id: quiz_check_run | ||
run: | | ||
Rscript -e "ottr::check_quizzes(quiz_dir = 'quizzes', write_report = TRUE, verbose = TRUE)" | ||
results=0 | ||
if -f "question_error_report.tsv"; then | ||
results=$(wc -l < question_error_report.tsv >/dev/null) | ||
fi | ||
echo ::set-output name=quiz_chk_results::$results | ||
- name: Commit quiz check errors | ||
run: | | ||
branch_name='check-${{ github.event.pull_request.number }}' | ||
git diff --name-only origin/main -- question_error_report.tsv >/dev/null && changes=true || changes=false | ||
echo $changes | ||
if $changes == true; then | ||
git diff --name-only origin/$branch_name question_error_report.tsv >/dev/null && changes=true || changes=false | ||
echo $changes | ||
if $changes == true; then | ||
git add --force question_error_report.tsv | ||
git diff-index --quiet HEAD || git commit -m 'Add question error report file' | ||
git pull --set-upstream origin $branch_name --allow-unrelated-histories | ||
git push origin $branch_name | ||
fi | ||
fi | ||
- name: Build components of the quiz check comment | ||
id: build-components | ||
env: | ||
GH_PAT: ${{ secrets.GH_PAT }} | ||
run: | | ||
branch_name='check-${{ github.event.pull_request.number }}' | ||
quiz_error_url=https://raw.githubusercontent.com/${GITHUB_REPOSITORY}/$branch_name/question_error_report.tsv | ||
echo ::set-output name=time::$(date +'%Y-%m-%d') | ||
echo ::set-output name=commit_id::$GITHUB_SHA | ||
echo ::set-output name=quiz_error_url::$quiz_error_url | ||
# Handle the commenting | ||
- name: Find Comment | ||
uses: peter-evans/find-comment@v1 | ||
id: fc | ||
with: | ||
issue-number: ${{ github.event.pull_request.number }} | ||
comment-author: 'github-actions[bot]' | ||
body-includes: quiz errors | ||
|
||
- name: Quiz errors! | ||
if: ${{ steps.quiz_check_run.outputs.quiz_chk_results >= 2 }} | ||
uses: peter-evans/create-or-update-comment@v1 | ||
with: | ||
comment-id: ${{ steps.fc.outputs.comment-id }} | ||
issue-number: ${{ github.event.pull_request.number }} | ||
body: | | ||
:warning: There are quiz errors that need to be addressed. [Read this guide for more info](https://github.com/jhudsl/OTTR_Template/wiki/Publishing-on-Leanpub#setting-up-quizzes). | ||
[Download the errors here.](${{ steps.build-components.outputs.quiz_error_url }}) | ||
_Comment updated at ${{ steps.build-components.outputs.time }} with changes from ${{ steps.build-components.outputs.commit_id }}_ | ||
edit-mode: replace | ||
|
||
- name: Check quiz check results - fail if too many errors | ||
if: ${{ steps.quiz_check_run.outputs.quiz_chk_results >= 2 }} | ||
run: exit 1 | ||
|
||
- name: No quiz errors | ||
if: ${{ steps.quiz_check_run.outputs.quiz_chk_results < 2 }} | ||
uses: peter-evans/create-or-update-comment@v1 | ||
with: | ||
comment-id: ${{ steps.fc.outputs.comment-id }} | ||
issue-number: ${{ github.event.pull_request.number }} | ||
body: | | ||
No quiz errors detected! :tada: | ||
_Comment updated at ${{ steps.build-components.outputs.time }} with changes from ${{ steps.build-components.outputs.commit_id }}_ | ||
edit-mode: replace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.