generated from jhudsl/OTTR_Template
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🔄 Synced local '.github/workflows/' with remote '.github/workflows/'
release-null
- Loading branch information
Showing
4 changed files
with
56 additions
and
34 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,9 +14,10 @@ jobs: | |
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
token: ${{ secrets.GH_PAT }} | ||
|
||
# Use the yaml-env-action action. | ||
- name: Load environment from YAML | ||
|
@@ -31,15 +32,17 @@ jobs: | |
# Make the branch fresh | ||
- name: Make the branch fresh | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "jhudsl-robot" | ||
git config --global --add safe.directory $GITHUB_WORKSPACE | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "jhudsl-robot" | ||
branch_name='preview-${{ github.event.pull_request.number }}' | ||
echo branch doesnt exist | ||
git checkout -b $branch_name || echo branch exists | ||
git push --set-upstream origin $branch_name | ||
shell: bash | ||
|
||
|
||
outputs: | ||
toggle_spell_check: "${{ env.SPELL_CHECK }}" | ||
toggle_style_code: "${{ env.STYLE_CODE }}" | ||
|
@@ -58,6 +61,7 @@ jobs: | |
check_type: spelling | ||
error_min: 3 | ||
gh_pat: secrets.GH_PAT | ||
branch_name: ${GITHUB_HEAD_REF} | ||
|
||
url-check: | ||
name: Check URLs | ||
|
@@ -68,6 +72,7 @@ jobs: | |
check_type: urls | ||
error_min: 0 | ||
gh_pat: secrets.GH_PAT | ||
branch_name: ${GITHUB_HEAD_REF} | ||
|
||
quiz-check: | ||
name: Check quiz formatting | ||
|
@@ -78,6 +83,7 @@ jobs: | |
check_type: quiz_format | ||
error_min: 0 | ||
gh_pat: secrets.GH_PAT | ||
branch_name: ${GITHUB_HEAD_REF} | ||
|
||
############################# Style the code ################################### | ||
style-code: | ||
|
@@ -90,7 +96,7 @@ jobs: | |
|
||
steps: | ||
- name: Checkout files | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
|
@@ -116,16 +122,16 @@ jobs: | |
|
||
steps: | ||
- name: Checkout files | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
# Set up git checkout | ||
- name: Set up git checkout | ||
run: | | ||
git config --system --add safe.directory "$GITHUB_WORKSPACE" | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "jhudsl-robot" | ||
git config --global --add safe.directory $GITHUB_WORKSPACE | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "jhudsl-robot" | ||
branch_name='preview-${{ github.event.pull_request.number }}' | ||
git fetch --all | ||
|
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 |
---|---|---|
|
@@ -10,6 +10,7 @@ on: | |
paths: | ||
- '**.Rmd' | ||
- assets/* | ||
- quizzes/* | ||
|
||
jobs: | ||
|
||
|
@@ -18,7 +19,7 @@ jobs: | |
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
|
||
# Use the yaml-env-action action. | ||
- name: Load environment from YAML | ||
|
@@ -29,6 +30,7 @@ jobs: | |
toggle_bookdown: "${{ env.RENDER_BOOKDOWN }}" | ||
toggle_coursera: "${{ env.RENDER_COURSERA }}" | ||
toggle_leanpub: "${{ env.RENDER_LEANPUB }}" | ||
make_book_txt: "${{ env.MAKE_BOOK_TXT }}" | ||
rendering_docker_image: "${{ env.RENDERING_DOCKER_IMAGE }}" | ||
toggle_quiz_check: "${{ env.CHECK_QUIZZES }}" | ||
|
||
|
@@ -42,16 +44,16 @@ jobs: | |
|
||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
token: ${{ secrets.GH_PAT }} | ||
|
||
- name: Login as jhudsl-robot | ||
run: | | ||
git config --system --add safe.directory "$GITHUB_WORKSPACE" | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "jhudsl-robot" | ||
git config --global --add safe.directory $GITHUB_WORKSPACE | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "jhudsl-robot" | ||
# We want a fresh run of the renders each time | ||
- name: Delete old docs/* | ||
|
@@ -78,10 +80,11 @@ jobs: | |
GH_PAT: ${{ secrets.GH_PAT }} | ||
run: | | ||
git remote set-url origin https://${GH_PAT}@github.com/${GITHUB_REPOSITORY} | ||
git fetch origin | ||
git add --force docs/* | ||
git commit -m 'Render bookdown' || echo "No changes to commit" | ||
git pull --allow-unrelated-histories --strategy-option=ours | ||
git push origin main || echo "No changes to push" | ||
git push -u origin main || echo "No changes to push" | ||
render-tocless: | ||
name: Render TOC-less version for Leanpub or Coursera | ||
|
@@ -93,15 +96,16 @@ jobs: | |
|
||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
token: ${{ secrets.GH_PAT }} | ||
|
||
- name: Login as jhudsl-robot | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "jhudsl-robot" | ||
git config --global --add safe.directory $GITHUB_WORKSPACE | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "jhudsl-robot" | ||
# Rendered content for Leanpub and Coursera is very similar. | ||
# This job creates a shared scaffold for both. | ||
|
@@ -115,10 +119,11 @@ jobs: | |
GH_PAT: ${{ secrets.GH_PAT }} | ||
run: | | ||
git remote set-url origin https://${GH_PAT}@github.com/${GITHUB_REPOSITORY} | ||
git fetch origin | ||
git add --force docs/no_toc* | ||
git commit -m 'Render toc-less' || echo "No changes to commit" | ||
git pull --allow-unrelated-histories --strategy-option=ours | ||
git push origin main || echo "No changes to push" | ||
git push -u origin main || echo "No changes to push" | ||
render-leanpub: | ||
name: Finish Leanpub prep | ||
|
@@ -130,15 +135,16 @@ jobs: | |
|
||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
token: ${{ secrets.GH_PAT }} | ||
|
||
- name: Login as jhudsl-robot | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "jhudsl-robot" | ||
git config --global --add safe.directory $GITHUB_WORKSPACE | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "jhudsl-robot" | ||
# Create screenshots | ||
- name: Run the screenshot creation | ||
|
@@ -153,16 +159,25 @@ jobs: | |
--output_dir resources/chapt_screen_images) | ||
# We want a fresh run of the renders each time | ||
- name: Delete old manuscript/ | ||
run: rm -rf manuscript/ | ||
- name: Delete manuscript/ | ||
env: | ||
GH_PAT: ${{ secrets.GH_PAT }} | ||
run: | | ||
rm -rf manuscript/ | ||
git remote set-url origin https://${GH_PAT}@github.com/${GITHUB_REPOSITORY} | ||
git fetch origin | ||
git add . | ||
git commit -m 'Delete manuscript folder' || echo "No changes to commit" | ||
git pull --allow-unrelated-histories --strategy-option=ours | ||
git push -u origin main || echo "No changes to push" | ||
- name: Run ottrpal::bookdown_to_embed_leanpub | ||
if: needs.yaml-check.outputs.toggle_quiz_check == 'no' | ||
run: | | ||
Rscript -e "ottrpal::bookdown_to_embed_leanpub( | ||
render = FALSE, \ | ||
chapt_img_key = 'resources/chapt_screen_images/chapter_urls.tsv', \ | ||
make_book_txt = TRUE, \ | ||
make_book_txt = as.logical('${{needs.yaml-check.outputs.make_book_txt}}'), \ | ||
quiz_dir = NULL)" | ||
- name: Run ottrpal::bookdown_to_embed_leanpub | ||
|
@@ -171,21 +186,20 @@ jobs: | |
Rscript -e "ottrpal::bookdown_to_embed_leanpub( | ||
render = FALSE, \ | ||
chapt_img_key = 'resources/chapt_screen_images/chapter_urls.tsv', \ | ||
make_book_txt = TRUE)" | ||
make_book_txt = as.logical('${{needs.yaml-check.outputs.make_book_txt}}'))" | ||
# Commit the rendered Leanpub files | ||
- name: Commit rendered Leanpub files | ||
env: | ||
GH_PAT: ${{ secrets.GH_PAT }} | ||
run: | | ||
mkdir -p manuscript | ||
git remote set-url origin https://${GH_PAT}@github.com/${GITHUB_REPOSITORY} | ||
git add --force manuscript/* | ||
git add --force resources/* | ||
git add --force docs/* | ||
git commit -m 'Render Leanpub' || echo "No changes to commit" | ||
git pull --allow-unrelated-histories --strategy-option=ours | ||
git push origin main || echo "No changes to push" | ||
git push --force --set-upstream origin main || echo "No changes to push" | ||
render-coursera: | ||
name: Finish Coursera prep | ||
|
@@ -197,15 +211,16 @@ jobs: | |
|
||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
token: ${{ secrets.GH_PAT }} | ||
|
||
- name: Login as jhudsl-robot | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "jhudsl-robot" | ||
git config --global --add safe.directory $GITHUB_WORKSPACE | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "jhudsl-robot" | ||
# Run Coursera version | ||
- name: Convert Leanpub quizzes to Coursera | ||
|
@@ -219,9 +234,10 @@ jobs: | |
GH_PAT: ${{ secrets.GH_PAT }} | ||
run: | | ||
git remote set-url origin https://${GH_PAT}@github.com/${GITHUB_REPOSITORY} | ||
git fetch origin | ||
git add --force manuscript/* | ||
git add --force resources/* | ||
git add --force docs/* | ||
git commit -m 'Render Coursera quizzes' || echo "No changes to commit" | ||
git pull --allow-unrelated-histories --strategy-option=ours | ||
git push origin main || echo "No changes to push" | ||
git push -u origin main || echo "No changes to push" |
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