Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Staging branch with what's in main #438

Merged
merged 64 commits into from
Feb 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
3c138c7
Return to pre-gist method of spell check (#409)
cansavvy Jan 24, 2022
3980e65
Update screenshot for new repo (#410)
cansavvy Jan 24, 2022
116ae6a
Update template button screenshot (#411)
cansavvy Jan 24, 2022
5fb0a94
See if `fetch-depth: 0` fixes the shallow problem (#412)
cansavvy Jan 24, 2022
8d443c8
Render bookdown
actions-user Jan 24, 2022
125cad2
Update screenshot for git-secret.png (#414)
cansavvy Jan 24, 2022
630aa85
syntax updates
cansavvy Jan 25, 2022
db76224
Needed a semicolon
cansavvy Jan 25, 2022
5302d5b
Fix branch handling
cansavvy Jan 25, 2022
47ec163
Update spell check set up
cansavvy Jan 25, 2022
8f822be
Update main
cansavvy Jan 25, 2022
0152825
add brackets
cansavvy Jan 25, 2022
455ec10
set shell intentionally
cansavvy Jan 25, 2022
25381f1
fix if statements
cansavvy Jan 25, 2022
5cf38cf
Create PR if it can't push directly
cansavvy Jan 26, 2022
f176d52
Make sure it merges
cansavvy Jan 26, 2022
5eb8870
Alter branch test
cansavvy Jan 26, 2022
c2a289e
quote the 0?
cansavvy Jan 26, 2022
128ecc9
switch to -z
cansavvy Jan 26, 2022
1cc05a2
Delete extra then
cansavvy Jan 26, 2022
b034556
This should work
cansavvy Jan 26, 2022
17d8cd9
Change to preview- again whoops
cansavvy Jan 26, 2022
6f58e38
Add a push step
cansavvy Jan 26, 2022
8aec239
Update starting course
cansavvy Jan 26, 2022
800cb6b
set upstream
cansavvy Jan 26, 2022
65579db
Merge pull request #418 from jhudsl/cansavvy/tweak-git
jhudsl-robot Jan 26, 2022
623fed7
Set to bash intentionally (#419)
cansavvy Jan 26, 2022
42b427f
Test leanpub from here (#420)
cansavvy Jan 26, 2022
add62e8
Render leanpub
actions-user Jan 26, 2022
8e9141c
Minor polishing of steps (#421)
cansavvy Jan 27, 2022
379ae9d
Update README.md
cansavvy Feb 2, 2022
2b41fa8
Render leanpub
actions-user Feb 2, 2022
be5e01c
Add new repository to sync
tmm211 Feb 2, 2022
edfcce0
Merge pull request #425 from tmm211/patch-1
jhudsl-robot Feb 3, 2022
fe69ebe
Polish Examples in Rmds (#426)
cansavvy Feb 3, 2022
7ff09d9
Render bookdown
actions-user Feb 3, 2022
1f33429
Render bookdown (#427)
cansavvy Feb 3, 2022
7225471
Prep for ottr rename (#428)
cansavvy Feb 3, 2022
fc4f1c6
Render bookdown
actions-user Feb 3, 2022
168649c
Make docker unfail (#431)
cansavvy Feb 4, 2022
730e61a
Render bookdown
actions-user Feb 4, 2022
993cc35
Try out screenshot creator as a part of the new Leanpub set up (#422)
cansavvy Feb 4, 2022
3d5b3d3
Delete old manuscript files
cansavvy Feb 4, 2022
7b13526
Copy over assets
cansavvy Feb 4, 2022
e0ba661
Render bookdown
actions-user Feb 4, 2022
6b7c3fa
Remove manuscript if it is there
cansavvy Feb 4, 2022
6d89ebd
Set group and user id to get rid of permissions probs
cansavvy Feb 4, 2022
1591736
Forgot \ 's
cansavvy Feb 4, 2022
37230ab
Render bookdown
actions-user Feb 4, 2022
8b1d4a7
Make it force push
cansavvy Feb 4, 2022
9595cfb
only force manuscript dir
cansavvy Feb 4, 2022
24a59a2
Render Leanpub
actions-user Feb 4, 2022
93b2a01
Render Leanpub
actions-user Feb 4, 2022
cf02cb0
Render Leanpub
actions-user Feb 5, 2022
4eb33d9
Add to transfer PRs
cansavvy Feb 5, 2022
23dfd63
Delete manuscript folder
cansavvy Feb 5, 2022
b252154
Add to sync.yml
cansavvy Feb 5, 2022
ef6eb85
Render Leanpub
actions-user Feb 5, 2022
c3c836b
Remove _Template bit
cansavvy Feb 5, 2022
5ebc45e
Add coursera bit and _Quizzes
cansavvy Feb 5, 2022
0d0e338
Clean out manuscript folder when starting new course
cansavvy Feb 5, 2022
7bb4ce4
Make transfers go to the right folder
cansavvy Feb 5, 2022
a52d635
add /
cansavvy Feb 5, 2022
8e4c46e
Update sync.yml with OTTR_Template_Website (#437)
cansavvy Feb 8, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 3 additions & 13 deletions .github/automatic-issues/git-secrets.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,9 @@ It's important that these are set up and named exactly what they are below in or

To set up these repository secrets, on your repository's main Github page, go to `Settings` and scroll down to see `Secrets` on the left side menu bar.

For each new secret, click the `New repository secret` button and set each as follows, clicking `Add secret` as you fill each in appropriately:

- [ ] Set `DOCKERHUB_USERNAME`
`Name`: `DOCKERHUB_USERNAME`
`value`: put your login username for https://hub.docker.com/

- [ ] Set `DOCKERHUB_TOKEN`
`Name`:`DOCKERHUB_TOKEN`
`value`: put a access token for Dockerhub which you can create this by following [these instructions](https://docs.docker.com/docker-hub/access-tokens/#create-an-access-token).

- [ ] Set `GIT_TOKEN`
`Name`: `GIT_TOKEN`
`value`: A personal access token [following these instructions](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token#creating-a-token).
- [ ] Set `GH_PAT`
`Name`: `GH_PAT`
`value`: A personal access token [following these instructions](https://github.com/jhudsl/OTTR_Template/wiki/Start-a-new-course#6-set-up-your-github-personal-access-token).
Underneath `Select scopes`, check both `repo` and `workflow`.
Then copy the PAT and save as the value.

Expand Down
4 changes: 2 additions & 2 deletions .github/automatic-issues/images-checklist.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ See [Setting Up Images and Graphics](https://github.com/jhudsl/OTTR_Template/wik
- [ ] The color palette choices of the slide are contrasted in a way that is friendly to those with color vision deficiencies.
You can check this using [Color Oracle](https://colororacle.org/).

- [ ] Every image is [inserted into the text](https://github.com/jhudsl/OTTR_Template/wiki/Setting-up-images-and-graphics#adding-images-and-graphics-in-text) using one of these options: `leanbuild::include_slide()`, `knitr::include_image()`, or this format: `<img src="blah.png" alt="SOMETHING">`.
- [ ] Every image is [inserted into the text](https://github.com/jhudsl/OTTR_Template/wiki/Setting-up-images-and-graphics#adding-images-and-graphics-in-text) using one of these options: `ottr::include_slide()`, `knitr::include_image()`, or this format: `<img src="blah.png" alt="SOMETHING">`.

- [ ] Every image has [alternative text added to it](https://github.com/jhudsl/OTTR_Template/wiki/Setting-up-images-and-graphics#adding-images-and-graphics-in-text).

- [ ] The beginning of each Rmd contains this chunk so the images are saved in the correct spot:

`````
```{r, include = FALSE}
leanbuild::set_knitr_image_path()
ottr::set_knitr_image_path()
```
`````
30 changes: 17 additions & 13 deletions .github/automatic-issues/set-repo-settings.md
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!
29 changes: 15 additions & 14 deletions .github/automatic-issues/templates-to-edit.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,8 @@

[Follow the Wiki instructions here](https://github.com/jhudsl/OTTR_Template/wiki/Setting-up-your-repository-files#setting-up-the-repository) for details on how to complete the items in this issue.
[Follow the Wiki instructions here](https://github.com/jhudsl/OTTR_Template/wiki/Start-editing-your-course) for details on how to complete the items in this issue.

The following files need to be edited to get this new course started!

### Picking a style

See more [about customizing style on this page in the guide](https://github.com/jhudsl/OTTR_Template/wiki/Change-Title-&-Customize-style).
By default this course template will use the jhudsl data science lab style. However, you can customize and switch this to another style set.

#### Using a style set

[Read more about the style sets here](https://github.com/jhudsl/OTTR_Template/wiki/Change-Title-&-Customize-style#using-a-style-set).

- [ ] On a new branch, copy the `style-sets/<set-name>/index.Rmd` and `style-sets/<set-name>/_output.yml` to the top of the repository to overwrite the default `index.Rmd` and `_output.yml`.
- [ ] Copy over all the files in the `style-sets/<set-name>/copy-to-assets` to the `assets` folder in the top of the repository.
- [ ] [Create a pull request](https://github.com/jhudsl/OTTR_Template/wiki/About-pull-request-review) with these changes, and double check the rendered preview to make sure that the style is what you are looking for.

### Files that need edited upon creating a new course.

- [ ] `README.md` - Fill in all the `{ }`.
Expand All @@ -28,6 +15,20 @@ By default this course template will use the jhudsl data science lab style. Howe
- [ ] `_bookdown.yml` - The list of Rmd files that need to be rendered needs to be updated. See [instructions](https://github.com/jhudsl/OTTR_Template/wiki/Publishing-with-Bookdown).
- [ ] `book.bib` - any citations need to be added. See [instructions](https://github.com/jhudsl/OTTR_Template/wiki/Citations).


### Picking a style

See more [about customizing style on this page in the guide](https://github.com/jhudsl/OTTR_Template/wiki/Change-Title-&-Customize-style).
By default this course template will use the jhudsl data science lab style. However, you can customize and switch this to another style set.

#### Using a style set

[Read more about the style sets here](https://github.com/jhudsl/OTTR_Template/wiki/Change-Title-&-Customize-style#using-a-style-set).

- [ ] On a new branch, copy the `style-sets/<set-name>/index.Rmd` and `style-sets/<set-name>/_output.yml` to the top of the repository to overwrite the default `index.Rmd` and `_output.yml`.
- [ ] Copy over all the files in the `style-sets/<set-name>/copy-to-assets` to the `assets` folder in the top of the repository.
- [ ] [Create a pull request](https://github.com/jhudsl/OTTR_Template/wiki/Start-editing-your-course#getting-started-with-the-github-workflow) with these changes, and double check the rendered preview to make sure that the style is what you are looking for.

### Files that need to be edited upon adding new packages that the book's code uses:

- `docker/Dockerfile` needs to have the new package added so it will be installed. See [instructions](https://github.com/jhudsl/OTTR_Template/wiki/Using-Docker#starting-a-new-docker-image).
Expand Down
4 changes: 2 additions & 2 deletions .github/automatic-issues/update-enrollment.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ We are working on adding more features and smoothing out bugs as we go.

If you want to receive updates from the original template to your course template, you will need to enroll this repository to the template updates by adding it to the `sync.yml` file.

- [ ] [Follow these instructions](https://github.com/jhudsl/OTTR_Template/wiki/Receiving-template-updates#how-to-enroll-a-repository-to-receive-template-updates) to enroll your course repository to receive these updates.
- [ ] [Follow these instructions](https://github.com/jhudsl/OTTR_Template/wiki/Start-a-new-course#10-enroll-your-repository-for-ottr-updates) to enroll your course repository to receive these updates.

- [ ] [Ensure that you have followed these instructions](https://github.com/jhudsl/OTTR_Template/wiki/Setting-up-your-repository-settings#add-jhudsl-robot-as-a-collaborator) to add the `jhudsl-robot` as a collaborator to your repository.
- [ ] [Ensure that you have followed these instructions](https://github.com/jhudsl/OTTR_Template/wiki/Start-a-new-course#5-add-jhudsl-robot-as-a-collaborator) to add the `jhudsl-robot` as a collaborator to your repository.
14 changes: 14 additions & 0 deletions .github/sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,15 @@ group:
jhudsl/GDSCN_Book_SARS_Galaxy_on_AnVIL
abyzovlab/CNVpytor_course
opencasestudies/OCS_Guide
tmm211/dsp-terra-mooc-test2
###ADD NEW REPO HERE following the format above#
files:
- source: .github/workflows/render-bookdown.yml
dest: .github/workflows/render-bookdown.yml
- source: .github/workflows/render-preview.yml
dest: .github/workflows/render-preview.yml
- source: .github/workflows/render-leanpub.yml
dest: .github/workflows/render-leanpub.yml
- source: .github/workflows/docker-build-test.yml
dest: .github/workflows/docker-build-test.yml
- source: .github/workflows/transfer-rendered-files.yml
Expand All @@ -44,6 +47,8 @@ group:
dest: .github/ISSUE_TEMPLATE/course-problem-report.md
- source: .github/ISSUE_TEMPLATE/course-content-add.md
dest: .github/ISSUE_TEMPLATE/course-content-add.md
- source: scripts/make_screenshots.R
dest: scripts/make_screenshots.R
- source: scripts/spell-check.R
dest: scripts/spell-check.R
- source: scripts/get_spell_errors.R
Expand All @@ -55,6 +60,15 @@ group:
- source: style-sets
dest: style-sets

repos: |
jhudsl/OTTR_Template_Website
- source: .github/workflows/style-and-sp-check.yml
dest: .github/workflows/style-and-sp-check.yml
- source: .github/workflows/url-checker.yml
dest: .github/workflows/url-checker.yml
- source: scripts/spell-check.R
dest: scripts/spell-check.R

###### TO ADD NEW REPOSITORY USE THIS FORMAT; Feel free to add/drop files that
# you specifically would like synced (or not).
#
Expand Down
117 changes: 117 additions & 0 deletions .github/workflows/check-quizzes.yml
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
12 changes: 0 additions & 12 deletions .github/workflows/delete-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,3 @@ jobs:
with:
github_token: ${{ secrets.GH_PAT }}
branches: preview-${{ github.event.pull_request.number }}

- name: Delete gist
id: gist
run: |
echo ${{ secrets.GH_PAT }} > docker/git_token.txt
gist_key=${GITHUB_REPOSITORY}_spell_check_${{ github.event.pull_request.number }}
gist_url=$(Rscript --vanilla scripts/get_the_gist.R \
--git_pat docker/git_token.txt \
--gist_key $gist_key \
--file resources/spell_check_results.tsv \
--delete)
rm docker/git_token.txt
9 changes: 7 additions & 2 deletions .github/workflows/docker-build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,15 @@ jobs:
if: ${{ github.head_ref == 'repo-sync/OTTR_Template/default' }}
run: |
echo This was tested on OTTR_Template no need to re-run
exit 1

# Set up Docker build
- name: Set up Docker Buildx
if: ${{ github.head_ref != 'repo-sync/OTTR_Template/default' }}
uses: docker/setup-buildx-action@v1

# Setup layer cache
- name: Cache Docker layers
if: ${{ github.head_ref != 'repo-sync/OTTR_Template/default' }}
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
Expand All @@ -61,13 +62,16 @@ jobs:

# Set up Docker build
- name: Set up Docker Build
if: ${{ github.head_ref != 'repo-sync/OTTR_Template/default' }}
uses: docker/setup-buildx-action@v1

- name: Get token
if: ${{ github.head_ref != 'repo-sync/OTTR_Template/default' }}
run: echo ${{ secrets.GH_PAT }} > docker/git_token.txt

# Build docker image
- name: Build Docker image
if: ${{ github.head_ref != 'repo-sync/OTTR_Template/default' }}
uses: docker/build-push-action@v2
with:
push: false
Expand All @@ -90,6 +94,7 @@ jobs:
run: docker push jhudsl/course_template

- name: Get the version
if: ${{ github.head_ref != 'repo-sync/OTTR_Template/default' }}
id: get_version
run: |
echo ::set-output name=version::$(echo $GITHUB_REF | cut -d / -f 3)
Expand All @@ -99,4 +104,4 @@ jobs:
if: ${{ github.event_name == 'release' }}
run: |
docker tag jhudsl/course_template:latest jhudsl/course_template:${{ steps.get_version.outputs.version }}
docker push jhudsl/course_template:1.0
docker push jhudsl/course_template:${{ steps.get_version.outputs.version }}
18 changes: 14 additions & 4 deletions .github/workflows/render-bookdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ jobs:
# This workflow contains a single job called "build-all"
render-main:
runs-on: ubuntu-latest
container:
image: jhudsl/course_template

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
Expand Down Expand Up @@ -75,13 +74,24 @@ jobs:
# Run bookdown rendering
- name: Run bookdown render
id: bookdown
run: Rscript -e "bookdown::render_book('index.Rmd', output_format = 'all')"
run: |
docker run \
--mount type=bind,target=/home/rstudio,source=$PWD \
--user "$(id -u):$(id -g)" \
jhudsl/course_template \
Rscript -e "bookdown::render_book('index.Rmd', output_format = 'all');
file.copy(from = 'assets', to = 'docs/assets', overwrite = TRUE)"

##### If you do not wish to host your course on Coursera, you can delete this section #####
# Run Coursera version
- name: Run Coursera version of render
id: coursera
run: Rscript -e "leanbuild::render_coursera()"
run: |
docker run \
--mount type=bind,target=/home/rstudio,source=$PWD \
--user "$(id -u):$(id -g)" \
jhudsl/course_template \
Rscript -e "ottr::render_coursera()"

##### End of Coursera rendering section ########################################

Expand Down
Loading