Skip to content

Commit

Permalink
Merge abcf1e6 into add62e8
Browse files Browse the repository at this point in the history
  • Loading branch information
cansavvy authored Jan 27, 2022
2 parents add62e8 + abcf1e6 commit ca6152d
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/check-quizzes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ 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:
Expand All @@ -35,6 +37,7 @@ jobs:
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
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/render-leanpub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ name: Render and publish Leanpub

on:
workflow_dispatch:
### UNCOMMENT THIS SECTION IF YOU WISH PREPARE YOUR COURSE FOR LEANPUB AUTOMATICALLY
# pull_request:
# branches: [ main ]
# types: [closed]
Expand All @@ -13,6 +14,7 @@ on:
# - docker/*
# - assets/*
# - quizzes/*
######### END OF SECTION #########

jobs:
# This workflow contains a single job called "build-all"
Expand All @@ -33,9 +35,11 @@ jobs:

# Run leanpub rendering
- name: Run leanbuild::bookdown_to_leanpub
run: |
Rscript -e "leanbuild::bookdown_to_leanpub(make_book_txt = TRUE);
leanbuild::render_coursera(convert_quizzes = TRUE)"
run: Rscript -e "leanbuild::bookdown_to_leanpub(make_book_txt = TRUE)"

# Convert quizzes to Coursera format
- name: Convert quizzes to coursera
run: Rscript -e "leanbuild::render_coursera(convert_quizzes = TRUE)"

# Commit the rendered leanpub files
- name: Commit rendered leanpub files
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/render-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ jobs:
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
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/style-and-sp-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ jobs:
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
Expand Down
7 changes: 7 additions & 0 deletions scripts/spell-check.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ dictionary <- c(dictionary, spelling::spell_check_text("⬇️")$word)

# Only declare `.Rmd` files but not the ones in the style-sets directory
files <- list.files(pattern = 'Rmd$', recursive = TRUE, full.names = TRUE)

# Get quiz file names
quiz_files <- list.files(file.path(root_dir, "quizzes"), pattern = '\\.md$', full.names = TRUE)

# Put into one list
files <- c(files, quiz_files)

files <- grep("About.Rmd", files, ignore.case = TRUE, invert = TRUE, value = TRUE)
files <- grep("style-sets", files, ignore.case = TRUE, invert = TRUE, value = TRUE)

Expand Down

0 comments on commit ca6152d

Please sign in to comment.